Skip to content

Support for multiple cookies with the same name from different domains #88

@jwalton

Description

@jwalton

Let's say you have a website at "foo.server.com", and you set a cookie called "session" with the domain "foo.server.com". Then you set a second cookie called "session" with the domain ".server.com". You might expect one cookie to overwrite the other, but actually what happens is the browser will send you both cookies. It seems like cookies right now can only parse the first one, but there are use cases where you want to retrieve both of them.

const request = {headers: {cookie: "foo=bar; foo=baz"}};
cookies = new Cookies(request, null, {});
cookies.get('foo'); // Returns 'bar', but what happened to 'baz'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions