mrjayviper
mrjayviper

Reputation: 2388

cookies not getting cleared in IE11 (cookie was set by writing to document.cookie via Javascript)

so I set some cookies manually via Javascript by writing to document.cookie and they are getting written fine.

I checked using

console.log(document.cookie)

My issue is that even if I manually cleared my history via

document.cookie still shows the cookie values I manually created.

Things I've tried:

Any ideas what I could be doing wrong?

Thanks

ps. While I can expire my cookie via Javascript. I cannot expect end users to do same. :)

Upvotes: 4

Views: 1761

Answers (3)

TituX75
TituX75

Reputation: 1

I had the same problem with IE11 working under Windows 8.1: somehow the delete Browser Cookie didn't take effect. I could verify it using Burp: the cookies were still sent to the website. I tried the various options:

  1. Internet options => Browsing History => Delete (untick "Preserve Favorites website data"). Click delete, and close IE11.
  2. Manually typing 'Document.cookie = ""' into the Developer Console
  3. Resetting IE to default configuration

The only thing that actually worked for me was clearing the Browser Cookies through the Developer Console, as mentioned by lloan. For IE11, it looks a bit different so if you are looking for it, here it is:

  1. Open the Developer Tools using F12
  2. Go to Network
  3. Click on "Clear cookies for domain"

For screenshot, see here

Upvotes: 0

Jonathan Chaplin
Jonathan Chaplin

Reputation: 2482

I've seen this happen if the website is "a favorite" in IE11. Can you try the following?

Go to Internet options => Browsing History => Delete (untick "Preserve Favorites website data"). Click delete, and close IE11.

Picture for reference 1 Picture for reference 2

If your website is not a favorite, let me know.

Upvotes: 8

lloan
lloan

Reputation: 1403

If you've already cleared your cookies the normal way, have you tried unchecking (if set) the Preserver Favorites Website Data option under Delete Browsing History? Tools > Safety > Delete Browsing History OR Ctrl + Shift + Delete.

If the above doesn't work, try pressing F12 and then Ctrl + R to clear browser cache, confirm you want to delete the browser cache. There is also an option to clear cookies for that specific domain under the Cache tab in Developer Tools Window.

enter image description here

Upvotes: 2

Related Questions