-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about the cookie #12
Comments
@cty945 so first of all in cookie-based authentication the cookie should be set by the server-side not by the client-side, since it's more secure and you can set a HTTP-only cookie that is not available for the client-side to edit. So the server sets the cookie on the response, and if you send cookies on HTTP responses the client automatically stores them. Secondly, regarding your question, if you check the code you can find a comment in
So what's happening is that passport has a built-in cookie.set method that's being called on req.login |
Thanks for the response! Yes I understand that the cookie has been set by the server. But the problem I encountered is actually on the client side. "the client automatically stores them" is not happening on my end when I try to reproduce it. Yes I did checked the response in Network tab, the cookies are there, but the client is not automatically storing them for some reason so that when the code checks whether the user has logged in it returned false. |
Hello again. In regards to this project, I just checked and ran a local setup called "Bla" Things for you to check
If it's related to some other project I'm not sure I can help you much |
This is actually not an issue but a question instead.
May I ask how/when did the cookie got saved into browser? I was looking for a line such as
cookies.set()
in the client side but could not find it and the cookie was set correctly indeed somehow.The text was updated successfully, but these errors were encountered: