0

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?

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

4 Comments

I already have that set to a higher number but does not work, once wifi drops it is timed out. How to display a message if the page is timed out, so that the user knows it is?
@sd_dracula You can do that with ajax call, if the ajax fail to get replay is trigger the fail function, and there you have lost the connection and you can show a message. I mean that you can use ajax to make the call time to time... if this fail you show a message.
Ok, how to go about doing just that?
@sd_dracula if you use jQuery: api.jquery.com/jQuery.ajax if not make a general javascript ajax call (an example: w3schools.com/ajax/ajax_xmlhttprequest_send.asp) Just search for ajax and you find many examples !
0

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>

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.