0

In my ASP.NET 4.0 Web Forms Application I'm working with forms authentication, and Cookieless is set to UseCookies. The Login control in out web project does not display an error message if cookies are disabled in the user's browser.

Is there a way to catch this error elegantly, in order to display a nice error message to users? Just "not logging in" is a bit confusing go them, obviously.

Matthias Meid
  • 12,455
  • 7
  • 45
  • 79

2 Answers2

4

As far as I know there are no asp.net shipped in way to detect is cookies disabled on the client. But there are several ways to detect it 'by hand'. Example1 example2

Community
  • 1
  • 1
Ph0en1x
  • 9,943
  • 8
  • 48
  • 97
0

Check out the answer by @Software Monkey and @thomasrutter on this post How to detect server-side whether cookies are disabled

These are the best approaches.

Community
  • 1
  • 1
Rich
  • 1,895
  • 3
  • 26
  • 35