Skip to content

it is not possible to unstate a cookie that was stated with options #2068

@csrl

Description

@csrl

If a cookie is created dynamically as such:

reply.state('session', sessionId, {path: '/auth'});

It is not possible to delete the cookie later by using:

reply.unstate('session');

As the expired cookie that is generated from the unstate call does not contain a matching path so the browser does not remove the first cookie.

However, if the cookie is first registered like so:

plugin.state('session', {path: '/auth'});

Then it can be unstated successfully as needed.

So reply.unstate() could be given an optional options parameter in order to generate the same cookie context for dynamically managing cookies.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug or defect

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions