implemented sessions controller and flash messages