January 29, 2010, Newsletter Issue #88: Using cookies

Tip of the Week

You can use cookies (local files) to store information instead of having to post variables back and forth between pages. It's easy - just use the request.cookies and response.cookies objects and methods. To save a value to a cookie, simply create a value, such as oranges: response.cookies("oranges") = 13 -- now you have a cookie on your computer with a key name of "oranges" which has a value 13. To retrieve the information, use the request.cookies method as: myVar = request.cookies("oranges") which will retrieve the value 13. You can also use the cookies as collections, such as response.cookies("oranges")("navels")=13. Now you have 13 Navel Oranges stored. To retrieve, use the same format: myVar = request.cookies("oranges")("navels").

About LifeTips

Now one of the top on-line publishers in the world, LifeTips offers tips to millions of monthly visitors. Our mission mission is to make your life smarter, better, faster and wiser. Expert writers earn dough for what they know. And exclusive sponsors in each niche topic help us make-it-all happen.

Not finding the advice and tips you need on this Web Development Tip Site? Request a Tip Now!


Guru Spotlight
Phyllis Serbes