Update login logic for session expiration too