How to Create Cookies – JavaScript Tutorial for Beginners




How do you set and update JavaScript cookies? The way to create a new cookie in JavaScript is really easy. Simply assign a string to the cookie property of the document object (document.cookie), formated in a key=value fashion.

points:
– cookies are associated with the document object (more on it later)
– cookies are shared across the entire application (domain)
– if you use a name for a cookie that’s already in use, the previous value will be overridden

Copyright (c) 2013 Rodrigo Silveira http://www.easylearntutorial.com

Original source


4 responses to “How to Create Cookies – JavaScript Tutorial for Beginners”

Leave a Reply