Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

ResponseCookies.Delete Not Deleting #565

Closed
@eriksendc

Description

@eriksendc

Hi All,

When signing out of our web application we're wanting to clear a cookie that's set during their use of the application. The weird thing is that

Response.Cookies.Delete("searchCriteria");

doesn't clear the cookie, but

Response.Cookies.Delete("searchCriteria", new CookieOptions() { Expires = DateTime.Now.AddDays(-1) });

does. If I set a break point right after the call to Delete(), in both cases it looks like the expiration of the cookie is set to something significantly old (January 1 1970) - so my passing in Expires = ... doesn't do anything.

I looked at ResponseCookies.cs and can't really reason this out (but it's been a long day and maybe I'm just not seeing the issue). Anyways, I'd have thought we'd want the expiration (set way at the bottom of ResponseCookies.cs to make the cookie go bye bye.

Thanks,
Brian Eriksen

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions