checking whether browser allows cookies in asp.net

Discussion in 'ASP .Net Security' started by Ollie, Jul 24, 2004.

  1. Ollie

    Ollie Guest

    Can you check whether a users browser allows you to use cookies?

    Cheers

    Ollie
     
    Ollie, Jul 24, 2004
    #1
    1. Advertising

  2. Ollie

    WL Guest

    I assumt his test (just like when testing whether JavaScript is supported)
    only checks whether the browser used SUPPORTS cookies (although they might
    have been disabled by the user) ?

    If so: the only real way of testing is by a multistep process sending a
    cookie and then trying to read it back.

    Wim


    "Jared" <> wrote in message
    news:...
    > if Request.Browser.Cookies = True
    >
    >
    >
    > "Ollie" <> wrote in message
    > news:...
    > > Can you check whether a users browser allows you to use cookies?
    > >
    > > Cheers
    > >
    > > Ollie
    > >
    > >

    >
    >



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.726 / Virus Database: 481 - Release Date: 22/07/04
     
    WL, Jul 24, 2004
    #2
    1. Advertising

  3. Ollie

    Saber Guest

    Sub Page_Load()
    If Not Page.IsPostBack Then
    If Request.QueryString("AcceptsCookies") Is Nothing Then
    Response.Cookies("TestCookie").Value = "ok"
    Response.Cookies("TestCookie").Expires = _
    DateTime.Now.AddMinutes(1)
    Response.Redirect("TestForCookies.aspx?redirect=" & _
    Server.UrlEncode(Request.Url.ToString))
    Else
    labelAcceptsCookies.Text = "Accept cookies = " & _
    Request.QueryString("AcceptsCookies")
    End If
    End If
    End Sub


    SOURCE: MSDN
    © Microsoft Corporation. All rights reserved.


    "Ollie" <> wrote in message
    news:...
    > Can you check whether a users browser allows you to use cookies?
    >
    > Cheers
    >
    > Ollie
    >
    >
     
    Saber, Jul 24, 2004
    #3
    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. Ollie
    Replies:
    3
    Views:
    431
    Saber
    Jul 24, 2004
  2. Replies:
    1
    Views:
    389
  3. Wladimir Borsov
    Replies:
    0
    Views:
    440
    Wladimir Borsov
    Nov 1, 2004
  4. _Who
    Replies:
    7
    Views:
    2,767
  5. Kenjis Kaan
    Replies:
    4
    Views:
    188
    Tad McClellan
    Sep 3, 2003
Loading...

Share This Page