login with cookie bug fix