DISABLE ADBLOCK

ADBlock is blocking some content on the site

ADBlock errore

Is there an alternative for Cookies to remember a users choice?

StackOverflow https://stackoverflow.com/questions/10815690

Question

we've (probably) got upcoming law in the Netherlands where i have to ask users if they allow me to use cookies on my site. Now it's easy when they say 'yes', because i can store that in a cookie.

You can see it coming: how can i remember the users choice when they say 'no'?

I only use cookies for Google analytics, so i can live with the 'no' answer and don't want to irritate the 'No' sayer every visit with the same question.

Solution

Maybe Local Storage in supported browsers for more or less permanent persisting

OTHER TIPS

You will need to use url-rewritting as a fallback approach

well then you can use html5's localstorage/sessionstorage objects for your requirement. these are very well supported on all the modern browsers. visit here for more details about HTML5 storage.

You can use Local storage

Please check this

  1. Why Local Storage
  2. How to use Local Storage

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow