Cookies headers are present but Cookies are not stored in browser
See original GitHub issueI’m making cross-domain request between two subdomains: sub1.local
and sub2.local
. Both are on local, as you see.
So I send POST
from sub1.local
to sub2.local
.
I recevie Cookie header: Set-Cookie: name=value; expires=Sun, 20-May-2018 21:38:08 GMT; Max-Age=3600; path=/; domain=.local
.
But there is no Cookie in browser storage.
All response headers:
HTTP/1.1 200 OK
Date: Sun, 20 May 2018 20:43:05 GMT
Server: Apache
Set-Cookie: name=value; expires=Sun, 20-May-2018 21:43:05 GMT; Max-Age=3600; path=/; domain=.local
Cache-Control: no-cache, private
Access-Control-Allow-Origin: http://sub1.local:8080
Vary: Origin
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
Content-Length: 2
Keep-Alive: timeout=10, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
What can be wrong?
I’ve tried add withCredentials: true
after reading this question - didn’t helped.
Issue Analytics
- State:
- Created 5 years ago
- Comments:16
Top Results From Across the Web
Cookies headers are present but Cookies are not stored in ...
You seem to be using CORS. To set a cookie with CORS you'll need to set the withCredentials flag when making the request....
Read more >7 Keys to the Mystery of a Missing Cookie - Medium
Check out the OPTIONS response header ACCESS-CONTROL-ALLOW-CREDENTIAL whether it is set to true . If the server doesn't allow credentials being ...
Read more >Set-Cookie in response header not stored in the browser, not ...
There could be multiple reasons for set-cookie response headers not being able to set cookies in the browser. We have listed them down...
Read more >cookies header are present but cookies are not stored ... - Reddit
Please help me to figure out why the browser (Chrome and any others) does not set cookies, while Set-Cookie header is present in...
Read more >Cookies headers are present but Cookies are not stored in ...
Related Query · Cookies headers are present but Cookies are not stored in browser · Custom cookie sent to browser but not stored...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For any poor SOB who lands on this page as I did,
127.0.0.1
!=localhost
. If you are serving your site fromlocalhost
(port whatever) and making CORS requests to127.0.0.1
(port whatever) cookies will not stick! Ensure to use either onlylocalhost
or only127.0.0.1
, but do not mix and match.I’ve found an answer on stack about the problem that Chrome won’t set Cookie if there is port in domain url. Can I remove port from domain url? I’m using vue-cli.