Can't get "Block all cookies" to work

Discussion in 'ASP .Net' started by Framework fan, Nov 5, 2003.

  1. 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.
     
    Framework fan, Nov 5, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. craig dicker
    Replies:
    9
    Views:
    693
    Juan T. Llibre
    Jul 7, 2005
  2. craig dicker
    Replies:
    1
    Views:
    391
    Peter Rilling
    Jul 10, 2005
  3. Xeno Campanoli
    Replies:
    1
    Views:
    352
    James Britt
    Jul 1, 2005
  4. 7stud --
    Replies:
    4
    Views:
    135
    7stud --
    Mar 27, 2009
  5. Guy
    Replies:
    2
    Views:
    194
    Dr John Stockton
    Dec 5, 2003
Loading...

Share This Page