Refactoring LoginController, Handling of invalid session error
Merge result