Friday, 1 February 2013

document.cookie Property



document.cookie Property Javascript DOM  
The cookie property of the document object is used to set and access browser cookies. Cookies are used for creating persistent data storage that will be available over your entire domain because the file is stored in the user's browser software, and is associated with a particular domain name.
SYNTAX document.cookie

Javascript CODE EXAMPLE
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPbJ0m2FKoVgqgv3a6TIyVXkg01OloSyuJqxrw-qg9SHlavQqRiKXHTXTtuB5vuv_jv_2RyPPv35EXrC4GAvP5g5nI2Vz5KlTWEksI2HDtL0o64lEILmn2qvCUxNK9hZ-aLPJlbRXsyP4/s1600/Cookies.bmp


1. Test this on a website and not your local machine so that the browser software can associate the stored cookies with a domain name.
2. An existing cookie can be updated(overwritten) with a new value by re-baking it.
3. Each cookie is called into each page of your site with each request, so using cookies uses extra resources. The more cookies you use, the heavier the resources.
4. Cookies can be read and removed by the user via their browser software.