Ask a Question related to ASP.NET General, Design and Development.
-
Michal A. Valasek #1
Problem with deleting cookies
Hello,
I have problem deleting cookies and cookies values (using framework version
1.1 on W2003).
When I try to remove entire cookie, by calling
Response.Cookies.Remove("Test"), nothing happens, the cookie "Test" remains
unchanged.
When I try to remove one of cookie values, by calling
Response.Cookies("Test").Values.Remove(Key), all values are cleared (but
cookie itself remains), regardless what is used as Key - existing value
name, non-existent value name, empty string.
It seems to me as error in framework, because documentation says that it
should work. Or it's problem between keyboard and chair?
--
Michal A. Valasek, Altair Communications, [url]http://www.altaircom.net[/url]
Please do not reply to this e-mail, for contact see [url]http://www.rider.cz[/url]
Michal A. Valasek Guest
-
problem with cookies...
hi i do a survey in php i would like to allow only one vote but i don't know why, i can vote 2 times... the survey display with this... -
HTTPWebRequest + Cookies problem
Hi, In continue to another post which I have in this news group, I was able to find out some more details about the problem What is my... -
Problem with Forms Authentication cookies
Hi, We're having an issue with Forms Authentication cookies being treated as expired / invalid, and being deleted. This is causing our intranet... -
problem with LWP Cookies
Hello , I have been trying to use LWP to access a secured page. Its a 2 step process where initially I need to authenticate myself and the... -
#14389 [Com]: cookies problem
ID: 14389 Comment by: php at shop4host dot net Reported By: demon at dreamers dot gr Status: Closed Bug Type: ... -
Peter O'Reilly #2
Re: Problem with deleting cookies
No bug with the Framework, although as you have learned the Remove method is
a bit confusing to have for the Cookie collection. (Maybe this is because
the cookie collection inherits from some other collection and yes, I'm too
lazy to look :-).
Anyway, the solution to your problem is to set the expiration date of the
cookie to some value in the past. Actually once you create a cookie, you
can't access it's expiration date despite it being a read/write property in
the framework. This is due to the official/Non-Microsoft (Netscape/w3c)
cookie specification.
So if you are not confused at this point, the true solution is to create
another cookie in ASP.Net that has the same cookie name as the one you want
to delete and specify an expiration date to some value in the past. The idea
is the old cookie will be replaced by the new one. Alternatively, don't
specify an expiration date is effectively the same thing. Both will delete
the cookie at the end of the user's session.
Hope this helps.
--
Peter O'Reilly
"Michal A. Valasek" <news@altaircom.net> wrote in message
news:Oeff2IrUDHA.1812@TK2MSFTNGP11.phx.gbl...version> Hello,
>
> I have problem deleting cookies and cookies values (using frameworkremains> 1.1 on W2003).
>
> When I try to remove entire cookie, by calling
> Response.Cookies.Remove("Test"), nothing happens, the cookie "Test"> unchanged.
>
> When I try to remove one of cookie values, by calling
> Response.Cookies("Test").Values.Remove(Key), all values are cleared (but
> cookie itself remains), regardless what is used as Key - existing value
> name, non-existent value name, empty string.
>
> It seems to me as error in framework, because documentation says that it
> should work. Or it's problem between keyboard and chair?
>
> --
> Michal A. Valasek, Altair Communications, [url]http://www.altaircom.net[/url]
> Please do not reply to this e-mail, for contact see [url]http://www.rider.cz[/url]
>
>
Peter O'Reilly Guest



Reply With Quote

