Fix for login and logout with cookie