I want to use a cookie in my project...suppose my visitor selects an item and added to the cart...now he/she continues shopping after adding one item...now he/she selects second item which he wants to buy and adds to the cart...but i want to add the products first in a cookie and then to database also for back up or vice versa...
The problem i m having is that how to add two items in a same cookie..my code follows..
<%
pname=Request.Form("name")
pdesc=Request.Form("pdesc")
price=Request.Form("price")
picture=Request.Form("picture")
pieces=Request.Form("pieces")
uid=session.sessionID
response.write(pieces)
response.write(pname)
response.write(pdesc)
response.write(price)
response.write(picture)
response.write(uid)
inserting in the cookie
response.cookies("cart")("name")=Request.Form("nam e")
response.cookies("cart")("price")=Request.Form("
pr ice")
response.cookies("cart")("pdesc")=Request.Form("pd esc")
response.cookies("cart")("picture")=Request.Form(" picture")
response.cookies("cart")("pieces")=Request.Form("p ieces")
Response.write("inserted in the cookie")
for each cookiekey in request.cookies("cart")
response.write(cart) & " ."
response.write(cookiekey) & " ="
response.write(request.cookies("cart")(cookiekey))
next
%>
It only shows the last item added to the database or in cookie...the thing is it overwrites to the previous entries in the cookie....
Will anyone plz help me out in this..it will be highly appreciated!
Farzan Q.
BS(TeleCommunication)
Iqra University.