1

I want the user to be logged in until the user closes the browser window or specifically logs out. how this can be done? Should I use UserIsOnlineTimeWindow?

1

2 Answers 2

1

Use a javascript "keep alive" mechanism.

You will have to use a javascript setInterval to keep making ajax requests to your server.

This keeps the session alive for as long as the browser is open.

Note that is is a security risk, it is usually good to stop making these requests by clearing the interval after a definitely amount of time.

Extending the session timeout by setting it to very large number won't scale very well for a large number of users

0

You can set the session timeout in web.config...the max valid value of which 525601 minutes (1 year) - default is 20mins

<system.web> 
<sessionState timeout="20" /> 
<system.web> 
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.