Why set-cookie headers are ignored?

依然范特西╮ 提交于 2019-12-23 05:38:09

问题


When authenticating, the servers response with a cookie.

On localhost (both server and client), no problem, the cookie is received and stored. But when I use an address (pointing to localhost, by using /etc/hosts) instead of localhost for the client, then the cookie is not set.

I tried setting the domain field in cookie (with and without appending a dot): tokenOptions = {expires: false, httpOnly: true, domain: ".lch.lch.com"};

But still, even if in firebug I can see the cookie in the server response, it's not stored. I also tried some different domains, (localhost.com, lch.com, lch.lch.com), just to be sure it's not a problem with the number of dots or with the occurrence of localhost in the domain. But nothing worked. I tried once with Firefox, it worked,then after a domain change, I couldn't manage to make it work again in Firefox.

This is really driving me crazy, loosing so much time on some such basic stuffs...so any help will be really appreciated !

来源:https://stackoverflow.com/questions/59188249/why-set-cookie-headers-are-ignored

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!