问题
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