Larry Brister
asked on
ASP.NET remove cookie
What is the proper way to remove the cookie immediatley in the ELSE code below?
Dim RememberMe As Boolean
If ck1.Checked = True Then
RememberMe = True
Else
RememberMe = False
End If
If RememberMe = True Then
'If they choose to remember there account
Dim c As New System.Web.HttpCookie("royalUser", Trim(txtEmail.Text))
c.Expires = Now.AddMonths(1)
HttpContext.Current.Response.Cookies.Add(c)
Dim p As New System.Web.HttpCookie("royalPass", Trim(txtPassword.Text))
p.Expires = Now.AddMonths(1)
HttpContext.Current.Response.Cookies.Add(p)
Else
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If ck1.Checked = True Then
RememberMe = True
Else
RememberMe = False
End If
If RememberMe = True Then
'If they choose to remember there account
Dim c As New System.Web.HttpCookie("roy
c.Expires = Now.AddMonths(1)
HttpContext.Current.Respon
Dim p As New System.Web.HttpCookie("roy
p.Expires = Now.AddMonths(1)
HttpContext.Current.Respon
Else
Dim cookieCols As New HttpCookieCollection
cookieCols = Request.Cookies
Request.Cookies.Remove("ro
Request.Cookies.Remove("ro
End If