Fixed bug where user would be logged off despite not having a session