Added conditional deletions to session key for logout