Can't get "Block all cookies" to work

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sessions and Cookies dont work 2
What is the proper way to use cookies? 1
Cookies 7
Cookies 0
cookies.... 1
Clearing cookies 2
cookies question 3
Cookies C# 3

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top