Code Comments
Programming Forum and web based access to our favorite programming groups.If I have a cookie with 'key/value' pairs, how would I delete a specific 'key/value' pair while preserving the remaining pairs? I tried to do something like: cookie(key)="" but it didn't seem to work. I do not want to expire the cookie, just to delete the specified key. I'm working in javascript. Thanks in advance.
Post Follow-up to this messageTry something like
Response.Cookies("MyCookie")("MyKey") = '';
I am guessing you are working on Javascript on the server side, am I
correct?
--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Warp" <roxana.turcu@scop.ro> wrote in message
news:2267d508.0410280535.5503a801@posting.google.com...
> If I have a cookie with 'key/value' pairs, how would I delete a
> specific 'key/value' pair while preserving the remaining pairs? I
> tried to do something like:
> cookie(key)=""
> but it didn't seem to work. I do not want to expire the cookie, just
> to delete the specified key. I'm working in javascript.
> Thanks in advance.
Post Follow-up to this messageManohar thank you for your reply.
Anyway, the problem was that I was replacing the old cookie with it's value
minus the pair I wanted to delete. This method generates two cookies with th
e
same name and different paths...a little bit strange. I found that putting
the path in the new cookie solves the problem.
Warp
"Manohar Kamath" wrote:
> Try something like
>
> Response.Cookies("MyCookie")("MyKey") = '';
>
> I am guessing you are working on Javascript on the server side, am I
> correct?
>
> --
> Manohar Kamath
> Editor, .netWire
> www.dotnetwire.com
>
>
> "Warp" <roxana.turcu@scop.ro> wrote in message
> news:2267d508.0410280535.5503a801@posting.google.com...
>
>
>
Post Follow-up to this messageTry a javascript group. "Warp" <roxana.turcu@scop.ro> wrote in message news:2267d508.0410280535.5503a801@posting.google.com... > If I have a cookie with 'key/value' pairs, how would I delete a > specific 'key/value' pair while preserving the remaining pairs? I > tried to do something like: > cookie(key)="" > but it didn't seem to work. I do not want to expire the cookie, just > to delete the specified key. I'm working in javascript. > Thanks in advance.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.