G
Guest
Hi all,
Environment : ASP.NET
I am using cookies to store some data. this is done in a class which is
called by a web page CookieCreate.aspx. Here is a little bit of code of how i
create the cookie in the class
Dim context As HttpContext = HttpContext.Current
If Not context.Request.Cookies("CartID") Is Nothing Then
Return context.Request.Cookies("CartID").Value
Else
' Generate a new random GUID using System.Guid Class
Dim tempCartId As Guid = Guid.NewGuid()
context.Response.Cookies("CartID").Value =
tempCartId.ToString()
End If
Now when i want to delete this cookie in another page which is
CookieDelete.aspx i am not able to do it, the code that i am using to delete
it is
Session.Clear()
HttpContext.Current.Request.Cookies.Clear()
HttpContext.Current.Items.Clear()
i was thinking one of them shold delete all the cookies that my other
webpage might have opened but it is not, so the questions is how can i delete
a cookie from page B when page A or any other page has create it?
thanks
sameer
Environment : ASP.NET
I am using cookies to store some data. this is done in a class which is
called by a web page CookieCreate.aspx. Here is a little bit of code of how i
create the cookie in the class
Dim context As HttpContext = HttpContext.Current
If Not context.Request.Cookies("CartID") Is Nothing Then
Return context.Request.Cookies("CartID").Value
Else
' Generate a new random GUID using System.Guid Class
Dim tempCartId As Guid = Guid.NewGuid()
context.Response.Cookies("CartID").Value =
tempCartId.ToString()
End If
Now when i want to delete this cookie in another page which is
CookieDelete.aspx i am not able to do it, the code that i am using to delete
it is
Session.Clear()
HttpContext.Current.Request.Cookies.Clear()
HttpContext.Current.Items.Clear()
i was thinking one of them shold delete all the cookies that my other
webpage might have opened but it is not, so the questions is how can i delete
a cookie from page B when page A or any other page has create it?
thanks
sameer