Move checkSession to LoginController.
Put registerSocketMessages in separate method.