Complete the code to set a session key with a value in Redis.
SET session:user123 [1]The SET command stores a key with a value. Here, we set the session key session:user123 to the string "active".
Complete the code to set an expiration time of 3600 seconds on a session key.
EXPIRE session:user123 [1]The EXPIRE command sets the time to live for a key in seconds. Here, 3600 seconds means the session expires in one hour.
Fix the error in the command to retrieve the session value.
[1] session:user123The GET command retrieves the value stored at the given key. Using SET or others here would cause errors or wrong behavior.
Fill both blanks to delete a session key and then check if it still exists.
DEL [1] EXISTS [2]
We delete the session key session:user123 and then check if it exists. Both commands use the same key.
Fill all three blanks to set a session key with a value and expiration in one command.
SET [1] [2] [3] 1800
This command sets the key session:user789 with the value "logged_in" and expiration time of 1800 seconds (30 minutes). The EX option specifies the expiration in seconds.