Implemented session expiry mechanism.