| Creating Cookies |
|
Creating cookies is amazingly straightforward and simple. Here I have created a little demo that shows how easy it is to create a cookie in JavaScript. Here is the JavaScript function that creates a cookie with the user's name and an expiration date in the year 2050:
function setCookie() To call this function, we simply make it the onClick action of an HTML hyperlink or form button. Try out the demo. For information about the specific syntax of cookies, how a website creates and accesses them: http://home.netscape.com/newsref/std/cookie_spec.html. |