Cookies & Arrays

Results 1 to 2 of 2

Thread: Cookies & Arrays

  1. #1
    Ben Timby Guest

    Default Cookies & Arrays

    I am using an array to store items in a users shopping cart, I want to give the user the option of saving the contents into a cookie so they can continue shopping later. I thought I could do it like this:<BR><BR>Response.Cookies("ShoppingCart") = ShoppingCartArray<BR><BR>But I get a type mismatch. I figure I can loop thru the array and save each item as its own (whatever?) like this:<BR><BR>Response.Cookies("ShoppingCartItem1") = ShoppingCartArray(0,1)<BR>Response.Cookies("Shoppi ngCartItem2") = ShoppingCartArray(0,2)<BR>Response.Cookies("Shoppi ngCartItem3") = ShoppingCartArray(0,3)<BR><BR>But this seems like too much work to me, I will just save it into a database, and use a stored procedure to go thru and delete the shopping carts when they expire (based on the date they were added)<BR><BR>Any other suggestions?

  2. #2
    Join Date
    Dec 1969

    Default RE: Cookies & Arrays

    need a name of the cookie and must suply a expire time so it does not expire when they close the browser out like so<BR>Response.cookies("name")("shoppingkart")<BR> the first is the name second is the assignment

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts