refactored code in sessions_controller. deletion of unnecessary methods