views:

49

answers:

1

i have many sites under one asp.net forms authentification, they have mixed frameworks, some have 2.0 some 4.0. but it is all fine. everything works fine. but!!

here 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" />

Sometimes, after random time, for example two minutes, session on client ends, and he has again to enter password, why?? what am i missing?

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 
+1  A: 

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

Pranay Rana
so i have timeout=60, why doesnt it fits?
eba
@eba -- check the timeout propety on more detail on msdn to increase your time out
Pranay Rana
sessionstate config has nothing to do with forms authentication cookie timeouts.
RPM1984
@RPM1984 - as per me he gets logged out because of session time out only form the site
Pranay Rana
i dont understand your comment, sorry. the point im trying to make is session is server-side (adding a shopping cart, session["cart"] = cart;). the expiry of this item is done by your above answer. but forms auth cookie is client-side, the expiry is done by forms timeout=60, which he has. forms authentication cookie != session.
RPM1984