Over a million developers have joined DZone.

Accessing and Writing Client-Created Cookies in AngularJS

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

AngularJS provides a $cookieStore object that reads and writes cookies. Here is a sample JSFiddle (my new favorite toy) that demonstrates setting a cookie value and bumping it by one each time the button is clicked.

Note - you won't see the number bump in the iFrame-embedded JSFiddle... Only if you jump to the JSFiddle site to test with it! This is Cross-Site Scripting protection in action...

Original discussion source was this Stack Overflow article.

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.


Published at DZone with permission of Ken Rimple, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}