O'Reilly logo

CodeIgniter 2 Cookbook by Rob Foster

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Confirming cookie acceptance from the user

Various states and regions now require websites to ask their users if they approve of that website writing cookies to their computer. There is some debate as to how this can be provisioned by the website and what constitutes approval from the user. You may have noticed that recently websites display a notice to the user requesting approval. Something called Implied Consent is the current thinking; a notice is shown informing the user that if they continue to use the site they are happy with the cookies being written.

The following recipe does just that; and a notice is shown to the user that will disappear if they click on a link indicating they are happy with cookies being written.

Getting ready

We need ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required