Best way to handle web app connection timeout ?
rjb at robelko.com
Tue Feb 22 12:13:24 CST 2005
>Thanks for the reply, but actually it doesn't help much...
>One thing I forgot to mention is that I'm also using a
>similar token generation technique to identify each user,
>in another part of the same project that involves a website
>on which being connected doesn't always mean being
>logged, as some pages are available to non-members (users
>who don't have a log & pwd).
I have also multiple tokens that allow me to track various things.
>But as you said, these token need to be saved on the client
>side somehow in order to survive crash... and I don't want
>to save anything on the client side...
Creating a text file with a single line should not be a problem. It
gets deleted when user disconnects (or quits the program).
But you can consider not saving the token but requiring users to
login again after the crash. That is pretty standard in internet.
Your cgi will just have to prematurely expire a token for a given
user if he/she logs in again. You can display a warning about that.
There is no perfect solution to this as far as I can see. But may be
someone has a better yet approach.
>I've made some experiments with the technique described in
>my previous post : sending automatic requests every minute
>or so to the server... it works fine, but I'm still worried about
>increase of activity on the server side...
Aside from generating quite a bit of traffic, if you have many users
logged in, the cgi will be quite busy just keeping track who is there
and who is not, which is likely to affect performance. And this way
of checking is subject to vagaries of internet. Any temporary glitch
somewhere and user that went out to fetch quickly coffee can get
disconnected by you.
More information about the use-livecode