简体   繁体   中英

asp.net session timeout on lost connection

I have an intranet page which needs to not time out (indefinitely) and I'm using JS to keep it alive that way.

But I am having one issue that happens when the user loses the connection (happens frequently due to to going in and out of wifi range) the session times out then.

How can I keep the session up/refresh it if that happens?

How about increase the session time out on web.config ?

<configuration>
  <system.web>
     <sessionState timeout="120"></sessionState>
  </system.web>
</configuration>

http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.timeout.aspx

Other possible way is to make your database, connected with the user cookie, and use your "custom session" data that are totally connected with your users.

Try using in web config if you are using Form Authentication

<system.web>
    <authentication mode="Forms">
          <forms timeout="120"/>
    </authentication>

    <sessionState timeout="120"  />
</system.web>

first Sets the session timeout on the server is for all session Rather than a single Session

out wifi range is the entire network are broken so not keep alive

You have to use cookie use cookie keep alive

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM