JavaScript cookies
Sometimes it is useful to employ javascript cookies for certain functionality. An example:
I want to have a DIV element which displays some information and which can be closed by the user (employing the toggle() or show() / hide() functions of jQuery). If the user has closed this box, I don’t want it to reappear for this session. This can be achieved with a small piece of javascript code that creates a cookie:
jQuery.cookie('cookiename', 'value');
To read the value of our cookie, we simply need to write the following:
jQuery('cookiename');
To utilize this, download this file and put it via javascript include tag in your HEAD of the site.
