|
 |
asp_web_howto thread: cookies how many values can I store
Message #1 by <odempsey@b...> on Wed, 16 Oct 2002 20:35:03 +0100
|
|
Hi folks
I have a question about cookies. How do I store multiple values in a cookie about one product e.g. if I want to say the product
item no. 1 is a car, is a ford, is red, is a petrol
would I write it like this?
Response.Cookies("shoppingCart")(1)= "type=car&make=ford&color=red&fuel=petrol"
or is there an easier way of doing it?
Kind Regards
Oliver Dempsey
==============================================
Oliver Dempsey
odempsey@b...
www.barrowvale.com
Barrowvale Technology Limited
Web Solutions for Business
Specialists in Dynamic Web Sites
Domain Registration, Hosting, Design,
SMS Text Messaging
Statistics, Online Training
Phone 00353 502 26263
Fax 00353 502 26952
Mobile 00353 86 8219430
==============================================
This e-mail, and any attachment, is confidential. If you have received
it in error, please delete it from your system, do not use or disclose
the information in any way and notify me immediately.
Message #2 by <odempsey@b...> on Thu, 17 Oct 2002 19:04:06 +0100
|
|
Hi folks
I posted this yesterday, does anybody know how to use cookies to store multiple values like this?
Oliver
----- Original Message -----
From: <odempsey@b...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Wednesday, October 16, 2002 8:35 PM
Subject: [asp_web_howto] cookies how many values can I store
> Hi folks
> I have a question about cookies. How do I store multiple values in a cookie about one product
e.g. if I want to say the product item no. 1 is a car, is a ford, is red, is a petrol
> would I write it like this?
> Response.Cookies("shoppingCart")(1)= "type=car&make=ford&color=red&fuel=petrol"
>
> or is there an easier way of doing it?
>
> Kind Regards
> Oliver Dempsey
>
> ==============================================
> Oliver Dempsey
> odempsey@b...
> www.barrowvale.com
> Barrowvale Technology Limited
> Web Solutions for Business
> Specialists in Dynamic Web Sites
> Domain Registration, Hosting, Design,
> SMS Text Messaging
> Statistics, Online Training
> Phone 00353 502 26263
> Fax 00353 502 26952
> Mobile 00353 86 8219430
> ==============================================
>
> This e-mail, and any attachment, is confidential. If you have received
> it in error, please delete it from your system, do not use or disclose
> the information in any way and notify me immediately.
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
Message #3 by Imar Spaanjaars <Imar@S...> on Thu, 17 Oct 2002 20:16:21 +0200
|
|
Hi Oliver,
Your way looks quite OK to me. Basically, you can create two kinds of
cookies: Flat and in an "array":
Response.Cookies("Mytest") = "Bla"
or
Response.Cookies("Mytest")("MySubCookie") = "Bla"
In your case, you'll need to store even more dimensions in a cookie, so the
only way left is to store the product attributes in the cookie value of a
subkey.
But of course a complete different approach is to not use cookies at all to
save product data. Save the product data to a database instead, and save
just the ID of the product in a cookie. That way, you won't hit the cookie
limit too fast (if at all)
Cheers,
Imar
At 07:04 PM 10/17/2002 +0100, you wrote:
>Hi folks
>I posted this yesterday, does anybody know how to use cookies to store
>multiple values like this?
>
>Oliver
>
>----- Original Message -----
>From: <odempsey@b...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Sent: Wednesday, October 16, 2002 8:35 PM
>Subject: [asp_web_howto] cookies how many values can I store
>
>
> > Hi folks
> > I have a question about cookies. How do I store multiple values in a
> cookie about one product
>e.g. if I want to say the product item no. 1 is a car, is a ford, is red,
>is a petrol
> > would I write it like this?
> > Response.Cookies("shoppingCart")(1)=
> "type=car&make=ford&color=red&fuel=petrol"
> >
> > or is there an easier way of doing it?
> >
> > Kind Regards
> > Oliver Dempsey
Message #4 by <odempsey@b...> on Thu, 17 Oct 2002 20:59:03 +0100
|
|
thanks Imaars
I was just checking in case I was making more work than necessary
Oliver
----- Original Message -----
From: "Imar Spaanjaars" <Imar@S...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Thursday, October 17, 2002 7:16 PM
Subject: [asp_web_howto] Re: cookies how many values can I store
> Hi Oliver,
>
> Your way looks quite OK to me. Basically, you can create two kinds of
> cookies: Flat and in an "array":
>
> Response.Cookies("Mytest") = "Bla"
>
> or
>
> Response.Cookies("Mytest")("MySubCookie") = "Bla"
>
>
> In your case, you'll need to store even more dimensions in a cookie, so the
> only way left is to store the product attributes in the cookie value of a
> subkey.
>
> But of course a complete different approach is to not use cookies at all to
> save product data. Save the product data to a database instead, and save
> just the ID of the product in a cookie. That way, you won't hit the cookie
> limit too fast (if at all)
>
> Cheers,
>
> Imar
>
>
> At 07:04 PM 10/17/2002 +0100, you wrote:
> >Hi folks
> >I posted this yesterday, does anybody know how to use cookies to store
> >multiple values like this?
> >
> >Oliver
> >
> >----- Original Message -----
> >From: <odempsey@b...>
> >To: "ASP Web HowTo" <asp_web_howto@p...>
> >Sent: Wednesday, October 16, 2002 8:35 PM
> >Subject: [asp_web_howto] cookies how many values can I store
> >
> >
> > > Hi folks
> > > I have a question about cookies. How do I store multiple values in a
> > cookie about one product
> >e.g. if I want to say the product item no. 1 is a car, is a ford, is red,
> >is a petrol
> > > would I write it like this?
> > > Response.Cookies("shoppingCart")(1)=
> > "type=car&make=ford&color=red&fuel=petrol"
> > >
> > > or is there an easier way of doing it?
> > >
> > > Kind Regards
> > > Oliver Dempsey
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
|
|
 |