troubleshooting Question

ie 9 not deleteing cookies c#

Avatar of scm0sml
scm0sml asked on
C#
5 Comments2 Solutions689 ViewsLast Modified:
I have the following code:
 var basketCookie = GetBasketCookie();
        
        basketCookie.Expires = DateTime.Now.AddDays(-10);
        Response.Cookies.Add(basketCookie);

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

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!!!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros