Fix bug related to session expiration