How to destroy cookies on the update page

Hello, I need to destroy javascript cookies on page refresh. I need to set a new bunch of cookies on every page load, which help me display a web page based on user preferences. Is there a way to destroy cookies when refreshing a page?

+5
source share
2 answers

You may delete cookies on the page.

For example with jQuery:

$(window).unload(function() {
  //Destroy cookies here
});
+2
source

You need to determine the page refresh, look:

Page Detection Update: Using Client-Side JavaScript

Once you know this, you can delete cookies.

+1

All Articles