Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Browser Capabilities Problem
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00708981
Message ID:
00709052
Views:
14
There is no way to query the browser to know if cookies are enabled. The only thing you can do is to create a cookie and then try to read the cookie back from the client. If successful, then cookies are enabled, if not then you will need to inform the client to turn on cookies to be able to run your app.

>I am trying to detect if a user's browser has JavaScript and or Cookies Enabled/Disabled. The Browser Capabilties component tells you if the user's browser supports JavaScript or Cookies but does NOT tell you if the user has these settings turned on or off.
>
>This is the very basic code I have:
>
>HttpBrowserCapabilities bc;
>string s;
>bc = Request.Browser;
>s = "Browser Capabilities" + "\n";
>s += "Name = " + bc.Browser + "\n";
>s += "Version = " + bc.Version + "\n";
>s += "Supports Cookies = " + bc.Cookies + "\n";
>s += "Supports JavaScript = " + bc.JavaScript + "\n";
>
>Does anyone know how to get this info? I can obviously tell if the user's browser is capable of support for these functions but don't know if what state the user's setting's are in?
>
>Basically bc.JavaScript and bc.Cookies are always TRUE for modern browsers but I need more info than that.
>
>Any help would be useful...Thanks.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform