How to logout a user when cookie is removed? #1454
Replies: 3 comments
-
I quess You use "Set-Cookie" by backend response? And just one cookie You have? For. Logout you should use the Logout method You don't have to use nuxt-universal-cookie as $auth have built in method for all storages. Going further you can check it on nuxtServerInit. But I think I should work out of the box with logout(). 🙄 |
Beta Was this translation helpful? Give feedback.
-
I know about logout func. And it works fine when user clicks on logout button I set up. But what is the flow when cookie is removed, in this case after browser close? I can't check if http-only cookie exists. And I don't want to logout a user on each page reload. Or should I just ditch http-only flag and make sure I don't have xss vulnerabilities? |
Beta Was this translation helpful? Give feedback.
-
I don't understand the issue. The browser is closed, so there's no app for the user to be logged out of? Where are you even checking |
Beta Was this translation helpful? Give feedback.
-
Hello,
Not sure how it should work ( not a lot of information in docs about cookie auth ).
I have minimal configuration at the moment ( tried different variations ).
Server sets http-only session cookie. After browser close I can see that it is removed in Application->cookies.
But user is still
logedIn
after browser close. For a second I thought to use something likenuxt-universal-cookie
to check if cookie exists. But this is http-only cookie so I can't access it.How should I logout a user?
Beta Was this translation helpful? Give feedback.
All reactions