Click to See Complete Forum and Search --> : Adding Data to A Cookie


Tricky123
12-03-2002, 11:22 AM
Any ideas how to add data to a cookie?

For example so as to store variables like document.text.value in addition to the regular cookie values?

Is this possible or just a dream on my part?

Tricky :confused:

Vladdy
12-03-2002, 11:28 AM
See http://www.vladdy.net/webdesign/cookies.html for a ready to use script.

Tricky123
12-03-2002, 11:40 AM
Cheers Vladdy,

But, being rather new to all this I can't see the said code!

thanks

tricky

Tricky123
12-04-2002, 05:02 AM
Sorry for being rather dim, but what does this mean??

Cheers

Atom290
12-04-2002, 08:18 AM
Can a cookie be stored on the local PC or does it have to go back to the web server?

gil davis
12-04-2002, 08:25 AM
Cookies are stored on the client's PC, not on the server. They are usually used for saving information pertaining to that particular client.

Atom290
12-04-2002, 08:29 AM
My cookies seem to disapear after I have created them!

I set the duration to 90 days, and in the function that creates the cookie if I do an alert to read it, it comes up correct. Once the function has finished I cannot read the value anymore :(

This is why I thought the variable might be stored on the web server..

Tricky123
12-05-2002, 06:10 AM
All,

Thanks for the help! I can now set my cookie and place in it any amount of data variables (up to their limit) and it will persist for more than the session.

How though, can I read the specific data variables back? I don't want any of the cookie values, only the data?


many TIA

Tricky123
12-05-2002, 07:40 AM
Hi,

I have tried to use the above code but keep getting 'out of stack flow errors' I have substitued the data with a data value and the dateobject with a real data object and called the function using a onClick button. What am I doing wrong?

TIA