Enhance session expiration

Clean up the code a bit for new session expiration methods and old `TS_KEY`