Home All Groups Group Topic Archive Search About
Author
21 Jan 2007 11:03 PM
Stimp
hi all,

I'm creating a cookie in the http context as follows:

Dim objCookie As HttpCookie = New HttpCookie("UserDetails")
objCookie.Values.Add("UserName", rRow("UserName"))

Response.Cookies.Add(objCookie)


When I try to delete the cookie using:

Response.Cookies.Remove("UserDetails")


it doesn't remove the cookie from the browser cache.

Is this the correct syntax for creation and removal of asp.net cookies?

Thanks,
Peter

--

fiddlewidawiddum

Author
21 Jan 2007 11:41 PM
Scott M.
Not really.  Just set the cookie's expiration date to a time in the past
like now minus one minute.
See:  http://www.codeproject.com/aspnet/aspnetcookies.asp for more details.


Show quoteHide quote
"Stimp" <r**@spumco.com> wrote in message
news:slrner7s96.qil.ren@murphy.redbrick.dcu.ie...
> hi all,
>
> I'm creating a cookie in the http context as follows:
>
> Dim objCookie As HttpCookie = New HttpCookie("UserDetails")
> objCookie.Values.Add("UserName", rRow("UserName"))
>
> Response.Cookies.Add(objCookie)
>
>
> When I try to delete the cookie using:
>
> Response.Cookies.Remove("UserDetails")
>
>
> it doesn't remove the cookie from the browser cache.
>
> Is this the correct syntax for creation and removal of asp.net cookies?
>
> Thanks,
> Peter
>
> --
>
> fiddlewidawiddum
Author
22 Jan 2007 12:35 PM
Stimp
On Sun, 21 Jan 2007 Scott M. <s-mar@nospam.nospam> wrote:
> Not really.  Just set the cookie's expiration date to a time in the past
> like now minus one minute.
> See:  http://www.codeproject.com/aspnet/aspnetcookies.asp for more details.

groovy thanks!

Show quoteHide quote
>
>
> "Stimp" <r**@spumco.com> wrote in message
> news:slrner7s96.qil.ren@murphy.redbrick.dcu.ie...
>> hi all,
>>
>> I'm creating a cookie in the http context as follows:
>>
>> Dim objCookie As HttpCookie = New HttpCookie("UserDetails")
>> objCookie.Values.Add("UserName", rRow("UserName"))
>>
>> Response.Cookies.Add(objCookie)
>>
>>
>> When I try to delete the cookie using:
>>
>> Response.Cookies.Remove("UserDetails")
>>
>>
>> it doesn't remove the cookie from the browser cache.
>>
>> Is this the correct syntax for creation and removal of asp.net cookies?
>>
>> Thanks,
>> Peter
>>
>> --
>>
>> fiddlewidawiddum
>
>


--

fiddlewidawiddum