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