Can you check whether a users browser allows you to use cookies?
Cheers
Ollie
Jared - 24 Jul 2004 16:29 GMT
if Request.Browser.Cookies = True
> Can you check whether a users browser allows you to use cookies?
>
> Cheers
>
> Ollie
WL - 24 Jul 2004 22:19 GMT
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
> if Request.Browser.Cookies = True
>
[quoted text clipped - 3 lines]
> >
> > Ollie
Saber - 24 Jul 2004 22:33 GMT
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.
> Can you check whether a users browser allows you to use cookies?
>
> Cheers
>
> Ollie