문제

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