Fixed bug where a new row in the session table would be added after every authentication attempt.