Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

  • Internet options => Browsing History => Delete (making sure "Cookies and other website data" is ticked)
  • Making sure "Delete browsing history on exit" is ticked and "Cookies and other website data" is also ticked

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

Things I've tried:

  • Close the tab. Manually clear my history. And then reopen my page on a new tab
  • Close IE11 completely. Reopen the app. And then open my page on a new tab

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. :)

like image 334
mrjayviper Avatar asked Dec 23 '22 08:12

mrjayviper


2 Answers

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 1Picture for reference 2

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

like image 94
Jonathan Chaplin Avatar answered Dec 25 '22 22:12

Jonathan Chaplin


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

like image 42
lloan Avatar answered Dec 25 '22 23:12

lloan