-
Notifications
You must be signed in to change notification settings - Fork 47
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 not accessible in subdomain in nextjs #38
Comments
You need to set the |
@Velik0ff I already tried this. |
I do not know what is the domain set in the environment variable, however, in order for I can see that in your case you have used |
I tried it by removing the |
I just saw that your requests are made with However, this is a big security issue that you introduce and I would advise on doing it only in isolated development environments. |
Bro what is localhost.com ? do you own this domain? |
Hi, I am facing problem to set and get cookies across the subdomains. let me explain my scenario. so we have a domain and two subomain like
localhost.com:3000
&admin.localhost:3000
,api.localhost:3000
( its on single nextjs server I just rewrite the url).I am trying to set cookie from
admin.localhost:3000
but fromapi.localhost.com:3000
API endpoint, the response header havingset-cookie
key but its not set in browser. you can check the screenshotHere is the response & request header:
No cookie set
once I changed the API endpoint to
admin.localhost.com:3000
the cookies is working fine. but this is not my case. I need to call all my request fromapi.localhost.com:3000
Note: I also tried with
sameSite
key withnone
,lax
. but its no working. need help on this. Thank youThe text was updated successfully, but these errors were encountered: