Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim redirect As String = Request.QueryString("redirect")
Dim acceptsCookies As String
' Was the cookie accepted?
If Request.Cookies("TestCookie") Is Nothing Then
Session("cookiesEnabled") = "False"
Response.Cookies("TestCookie").Expires = _
DateTime.Now.AddDays(-1)
Else
session("cookiesEnabled") = "True"
Response.Cookies("TestCookie").Expires = _
DateTime.Now.AddDays(-1)
End If
Session("isPostBack") = "True"
Response.Redirect("Default.aspx")
End Sub