0

A little background:

I have developed a web application in MVC3 that requires users to be logged in to access.

If the web page has been left for 5 minutes, a timer fires which makes a jQuery ajax call to the server, and returns a partial view which contains the logged in users email address, and a password textbox so that the user can re-enter their details before continuing to use the application.

I use Forms Authentication, with the cookie for it stored in the browser set to expire when the browser session closes (i.e. it does not have the Expires property set).

If I have the idle timer set to 10 seconds, or 1 minute, it works fine. If however I set it to 5 minutes, on the server the following is what I see:

HttpContext.Current.User.Identity.IsAuthenticated has value false HttpContext.Current.User.Identity.Name has value "empty"

So I cannot get to the currently logged in users details.

Any ideas?

eyeballpaul
  • 1,725
  • 2
  • 25
  • 39
  • see the answer http://stackoverflow.com/questions/6557023/form-cookie-expiring-too-soon-on-production-server. It did not help me but maybe it is the case with you. – Muhammad Adeel Zahid Jul 19 '12 at 15:21

2 Answers2

0

I have noticed that in my web.config, under the Authentication node, there is a timeout also set to 5 minutes which seemed to be affecting it. Hence why it worked fine for any requests below the 5 minutes mark. I changed this to 30 minutes and it appears at first glance to be working.

eyeballpaul
  • 1,725
  • 2
  • 25
  • 39
0

You can try keeping the settings of the user in web.config file, like isdebugmode,clientcode and fetch from there. Dot net nuke is not a bad choice either.

NG.
  • 5,695
  • 2
  • 19
  • 30
  • Thanks for your comment, however this issue ended up being the session time-out in the config. Also, DNN is a content management system, whereas this is a complex business application – eyeballpaul Jul 20 '12 at 09:08