Click to See Complete Forum and Search --> : Cookies in JavaScripts


bigduke
08-22-2003, 02:58 PM
Can someone shoe me how to wrtie a cookie in Java Script ?

Khalid Ali
08-22-2003, 03:51 PM
Here is a very simple cookie escript ..hope it helps..

http://www.webapplikations.com/pages/html_js/document/SimpleLoginCookieScript.html

bigduke
08-22-2003, 04:57 PM
Does the String string that the

document.cookie is set to have to be in a particuliar format ?

Khalid Ali
08-22-2003, 05:13 PM
don't understand????

bigduke
08-22-2003, 05:19 PM
Your code did

document.cookie = "SomethingSomething"

Isn't this the call the makes the cookie. Does this string have to be formatted in a fixed way ? Like

"duke.com" + escape( "My Name Is") blah blah blah

I tried your example without the domain or an expire date and the cookie file was never written. Hope this is clearer.