homepage Welcome to WebmasterWorld Guest from 23.20.220.79
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
inserting multiple entries into one cookie
new to js
lty83




msg:1487719
 4:50 pm on Jan 26, 2004 (gmt 0)

Hey guys

I have my site setup so that when you order something it pops up a confirm box asking if you would like to add that item to your cart, and then when you click yes or ok it adds a product="prodID" to teh cookie where "prodID" = that products unique ID in the db.

Now here comes the problem, when I try to write multiple entries to that single cookie named product it only shows me the last prodID added, i'm trying to work around this so that the cookie product could contain all the prodId's of any product selected.

Maybe the final outcome the cookie would look like
product=12321,12312,34235,23523 etc etc.

Looked around can't seem to find anything to get me started, like i said i have the confirmbox, and its pulling the id from the db, just not sure how to add more data to the end of a cookie entry.

Any help will be quite appreciated, thanks

 

HocusPocus




msg:1487720
 8:10 pm on Jan 26, 2004 (gmt 0)

I think you'll need something like
cookiedata = value1~data1¦value2~data2¦value3~data3

so that the cookiedata keeps to one string that contains multiple value/data pairs.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved