Implemented sessions mechanism for login/logout