The key exists but has no expiry
TTL returns -1 when the key exists but has no expiry. It returns -2 when the key does not exist, so "The key does not exist" is wrong.
Mixing up these two values is a common bug when you check whether a session was saved with a TTL.
Read more