Frage

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.

War es hilfreich?

Lösung

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

Andere Tipps

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
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top