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.

有帮助吗?

解决方案

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

其他提示

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top