Fixed logic error with user authentication

Server would generate new session_id regardless of necessity.