Implemented login/logout and restrictions