Remix.run Logo
speleding 7 months ago

The typical example of a path-based cookie is the "remember my login name" feature, where you want the cookie with the user name only available on the login page. (And you cannot use session storage because you want it to work whilst logged out.)

Xelynega 7 months ago | parent [-]

You don't need to store multiple login names for seperate pages though, so why can't this just be a site wide cookie?

speleding 7 months ago | parent [-]

That would include the cookie with each request, which is inefficient. And potentially it also can get sent with requests to other subdomains, which may not be desirable from a security point of view (it could be cdn.example.com, owned by someone else)