Skip to content
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

Cookie only added to subpath #442

Open
canac opened this issue Apr 10, 2021 · 1 comment
Open

Cookie only added to subpath #442

canac opened this issue Apr 10, 2021 · 1 comment

Comments

@canac
Copy link

canac commented Apr 10, 2021

In my app, I have the Netlify Identity widget on the page /login/. When the nf_jwt cookie is written, it doesn't have an explicit path, so it gets saved with the path /login/ (MDN docs). That means that the cookie is not sent to the server for requests in my app like /journal/ because /journal/ doesn't match the path /login/.

I think that this needs to be changed

document.cookie = `nf_jwt=${params["access_token"]}`;

to

document.cookie = `nf_jwt=${params["access_token"]};path=/`;

so that the cookie will be sent with all requests.

@kruncher
Copy link

I am noticing this behavior also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants