Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I append a cookie value to an exsisting stored cookie?

Status
Not open for further replies.

jazzz

Technical User
Feb 17, 2000
433
US
I have a cookie that I store on the clients machine lets call it MyCookie. The cookie is created on page1.asp. Now I have another value the I need to store but it doesn't become avaiable until the user moves to page2.asp.

If I add the value from Page2.asp to MyCookie does it append to the last line of MyCookie or does it recreate a 'New cookie called MyCookie with the 'New value? If that's the case I could create another cookie?

Life's a journey enjoy the ride...

jazzz
 
I recall having a similar problem previously and I suspect the answer to your topic question is no (since I did not do it that way). There is, however, a workaround for it. What I did was to take the values from my original cookie, put them into an array, delete the old cookie and then create a new cookie on the second page and add to it both the previous values as well as the new value. Hopefully this helps...

------------------------------------------------------------------------------------------------------------------------
"I am not young enough to know everything."
Oscar Wilde (1854-1900)
 
Thanks for the info. I assumed I couldn't so I just created another but I do like your array idea.

Life's a journey enjoy the ride...

jazzz
 
Glad I was able to add a little something. [thumbsup]

------------------------------------------------------------------------------------------------------------------------
"I am not young enough to know everything."
Oscar Wilde (1854-1900)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top