Avatar of scm0sml
scm0sml
 asked on

ie 9 not deleteing cookies c#

I have the following code:
 var basketCookie = GetBasketCookie();
        
        basketCookie.Expires = DateTime.Now.AddDays(-10);
        Response.Cookies.Add(basketCookie);

Open in new window


And this is the function:
 public HttpCookie GetBasketCookie()
    {
        var basketCookie = Request.Cookies["basket"];
        return basketCookie;
    }

Open in new window


For some reason the code I am using to remove the cookie is not being removed in ie9 meaning if they go back into the basket page their order is still in the basket.

This isn't what I want. Is working fine in other browsers.

Its worth nothing that even if I do delete cookies in ie9 the cookie won't die....

Works fine locally even in ie 9 just not when i'm running the live site.

Is there any sledge hammer way of killing the cookie in code?

Die cookie die!!!
C#

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
scm0sml

ASKER
I get the cookie in a number of places

If I ever want to change the name etc its in one place
SOLUTION
frmqit

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
scm0sml

ASKER
Seems to be behaving now.

Thanks both.
Dave Baldwin

You're welcome, glad to help.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23