JavaScript Cookie Library
Technorati Tags : JavaScript, Cookie, Code, Library
Close on the heels of my Generic AJAX Library I have written a cookie handling library.
For those not aware, a cookie is a small bit of data that a developer can leave on your PC to ‘rememember’ things. This technology was enabled because of the stateless nature of HTTP–the protocol that web pages are transmitted in. It allows programmers to leave information, such as your login preferences, on your computer to remember what your preferences were next time you come back to the site.
Most all web development languages and environments have methods of accessing and manipulating these bits of data, but JavaScript’s is very limited. You can read from and write to the document.cookie string, but all of the actual data formatting or interpreting is left to you to do manually.
This being the case, I have been wanting to write an OOP based version of a library that provides this functionalty to programmers in the JavaScript environment. Others have done the same in the past, and I am not claiming mine is much better. But I didn’t find everything that I was personally looking for in the ones I saw out there, and I love writing things myself. My friend Dustin has mentioned it before, and I agree with him–sometimes it’s better, even more fun, to re-invent the wheel. It also doesn’t hurt to get more examples of such code out there to help others who are Googling about hopelessly needing something like this.
So, I’ll leave you to my demonstration page for the Cookie Library, better known as cookieLib. Enjoy!
Powered By Qumana
--Jim



