Command
EXPIRE key seconds
Explanation
Sets a timeout on key. After the timeout has expired, the key will automatically be deleted.
Examples
Expire in 1 hour
EXPIRE session:1234 3600
EXPIRE key seconds
Sets a timeout on key. After the timeout has expired, the key will automatically be deleted.
Expire in 1 hour
EXPIRE session:1234 3600