Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Usersession and closing Browser...
#9
(04-17-2018, 02:46 PM)kudzu Wrote: There is no reliable way to detect when the user closes the browser. The best way is to just let the session time out.

Some other options that help...

You can enhance this by using a relatively short timeout.  But, that can cause the user to lose the session when working on a form.

The antidote to that is to set the form KeepAlive to True.  This causes an automatic message to be sent to the server to satisfy the timeout.  The KeepAlive message is timed to occur on a timing of about 1/3 or 1/4 the timeout so doesn't really increase the load much.  The user will never time out so long as the form is in the browser.

A caveat:  On many mobile devices (iStuff for sure) you will only get the KeepAlive when the form is active.  If the user brings up another form (placing your app in the background) it will not get the keepalive. For this reason, I set a different sessiontimeout for mobile sessions.

You can get a pretty responsive "timeout" without killing good user sessions.  However, if the user never closes the window (on a regular desktop) the session never times out from the built in timeout.   You can still create your own homemade timeout if necessary.

So... LOTS of options.

Dan
Reply


Messages In This Thread
Usersession and closing Browser... - by Mikey29 - 04-16-2018, 03:38 PM
RE: Usersession and closing Browser... - by kudzu - 04-16-2018, 07:50 PM
RE: Usersession and closing Browser... - by kudzu - 04-17-2018, 02:46 PM
RE: Usersession and closing Browser... - by kudzu - 04-17-2018, 02:46 PM
RE: Usersession and closing Browser... - by DanBarclay - 04-17-2018, 05:55 PM
RE: Usersession and closing Browser... - by kudzu - 04-17-2018, 06:26 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)