Click to See Complete Forum and Search --> : Objects in cookies ?


Yuriy Galanter
03-15-2000, 11:27 AM
Can I store an object (e.g. Dictionary) in a cookie ?

Yuri.

John Timney (MVP)
03-15-2000, 05:32 PM
you can only store text - but you could store the contents of the
dictionary as long as it wasn't too big, each cookie can only be 4k in size.

Browsers are not required to retain more than a total of 20 cookies from any
single domain
Browsers are not required to retain more than a total of 300 cookies

you can cheat a bit by concatonating strings from the dictionary and keys
into a single cookie to be parsed again later.

where:
key1=dictvalue1;
key2=dictvalue1;
key3=dictvalue1;
would be three cookies

this
keyCollection1=key1&dictvalue1:key2&dictvalue1:key3&dictvalue1;
is only one.

Much more flexible!

Regards

John Timney (MVP)

Yuriy Galanter <yuri@galanter.net> wrote in message
news:38cfa9e5@news.devx.com...
> Can I store an object (e.g. Dictionary) in a cookie ?
>
> Yuri.
>
>