eba
eba

Reputation: 673

ASP.NET authentication session

I have many sites under one ASP.NET forms authentication. They have mixed frameworks (some have 2.0, some 4.0, but it is all fine) Everything works fine, but sometimes, after a random time (for example two minutes) the session on the client ends, and he has to enter his password agian. Why? What am I missing?

Here is part of my web.config:

<authentication mode="Forms" ><forms loginUrl="../web/start_page/start_page.aspx"
    name=".ASPXFORMSAUTH" 
    protection="All"  
    path="/" 
    timeout="60" /></authentication>  
<machineKey
  validationKey="blablabla"
  validation="SHA1" />
<sessionState mode="InProc" stateNetworkTimeout="3600" />

Event Viewer shows:

Event code: 4005 
Event message: Forms authentication failed for the request. Reason: The ticket supplied    has expired. 
Event time: 21.09.2010 8:23:26 
Event time (UTC): 21.09.2010 4:23:26 
Event ID: e3a00bef332a4dec9cd1aa078a3d5aa4 
Event sequence: 277 
Event occurrence: 1 
Event detail code: 50202 

Upvotes: 2

Views: 751

Answers (1)

Pranay Rana
Pranay Rana

Reputation: 176956

its because session time out event occurs so you need to increase your session time something like this

<configuration>
  <sessionstate 
      mode="inproc"
      cookieless="false" 
      timeout="20" 
      sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>"
      server="127.0.0.1" 
      port="42424" 
  />
</configuration>

Timeout. This option controls the length of time a session is considered valid. The session timeout is a sliding value; on each request the timeout period is set to the current time plus the timeout value

Upvotes: 1

Related Questions