F
Framework fan
Hello.
I am having difficulty testing when the user selects "Block all
cookies" inside IE.
My trouble is that my test cookie never gets blocked.
I set IE's privacy level to "Block all cookies"
I set IE's Local Intranet security setting to High.
My simple code is as follows:
'Webform1 -- write a cookie
Dim ckeMyCookie As New HttpCookie("293692",
DateTime.Now.ToLongTimeString)
ckeMyCookie.Expires = DateTime.Now.AddDays(1)
Response.Cookies.Add(ckeMyCookie)
Response.Redirect("Webform2.aspx")
'Webform2 -- read the cookie
If Not Request.Cookies.Item("293692") Is Nothing Then
Dim ckeMyCookie As HttpCookie =
Request.Cookies.Item("293692")
If Not ckeMyCookie.Value = Nothing Then
Label2.Text = ckeMyCookie.Value
End If
End If
When I run the web app locally from the browser, the cookie *always*
works.
I am expecting that the cookie's value should *not* be read.
Unfortunately, the cookie's value is always read, and the current time
is always displayed.
(I've tried rebooting, and using different cookie names.)
Please can someone tell me where I've gone wrong.
Thank you very much in advance.
I am having difficulty testing when the user selects "Block all
cookies" inside IE.
My trouble is that my test cookie never gets blocked.
I set IE's privacy level to "Block all cookies"
I set IE's Local Intranet security setting to High.
My simple code is as follows:
'Webform1 -- write a cookie
Dim ckeMyCookie As New HttpCookie("293692",
DateTime.Now.ToLongTimeString)
ckeMyCookie.Expires = DateTime.Now.AddDays(1)
Response.Cookies.Add(ckeMyCookie)
Response.Redirect("Webform2.aspx")
'Webform2 -- read the cookie
If Not Request.Cookies.Item("293692") Is Nothing Then
Dim ckeMyCookie As HttpCookie =
Request.Cookies.Item("293692")
If Not ckeMyCookie.Value = Nothing Then
Label2.Text = ckeMyCookie.Value
End If
End If
When I run the web app locally from the browser, the cookie *always*
works.
I am expecting that the cookie's value should *not* be read.
Unfortunately, the cookie's value is always read, and the current time
is always displayed.
(I've tried rebooting, and using different cookie names.)
Please can someone tell me where I've gone wrong.
Thank you very much in advance.