I must be missing some basic thing about cookies. On localhost, when I set a cookie on server side and specify the domain explicitly as localhost (or .localhost). t
The only thing that worked for me was to set Path=/
on the cookie.
Moreover, the default value of a path attribute seems to be different from browsers to browsers although I tested only two of them (Firefox and Chrome).
Chrome tries to set a cookie as is; if path
attribute is omitted in Set-Cookie
header then it will not be stored and ignored.
However, Firefox stores a cookie even without an explicit path
attribute. It just set it with the requested path; my request url was /api/v1/users
and the path was set to /api/v1
automatically.
Anyway, both browsers worked when path
was set to /
even without an explicit domain, ie Domain=localhost
or something. So there are some differences in the way how each browser handles cookies.