Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Delete key\value pairs from a cookie
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Warp
10-28-04 08:55 PM


Re: Delete key\value pairs from a cookie
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...
> 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.



Report this thread to moderator Post Follow-up to this message
Old Post
Manohar Kamath
10-28-04 08:55 PM


Re: Delete key\value pairs from a cookie
Manohar 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... 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Warp
10-28-04 08:55 PM


Re: Delete key\value pairs from a cookie
Try 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.



Report this thread to moderator Post Follow-up to this message
Old Post
Paxton
11-01-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:07 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.