PDA

Click to See Complete Forum and Search --> : session timeout -session on_end problem


jeba
Jun 7th, 2001, 06:41 AM
Hi there!
Once a user logs in to my site, he should not be allowed to login from elsewhere. For this reason, I am setting a flag to true in the database when the user logs in, and setting the flag to false when he logs out. This works well, when the user logsout via the 'logout' page in the site. But on the other hand if he closes the browser, I am setting the flag to false in the database in session_onEnd event of global.asa file. But, session_onEnd() event doesn't fire always especially when the server is busy. This is the problem. So if a user forgot to logout, and he comes back next time, still the flag is on. So he is not allowed to logon.
Please help me. Is there anyother method to solve this problem?


BTW, does Response.Redirect work in Session_onEnd() event? If so, will it work even when the browser is closed?

Thanks in advance.

harsoni
Jun 7th, 2001, 01:15 PM
Try avoiding Sessions if u have other means of doing this operation. Why can't you do this in window_onload and
window_unload functions????


sonia:rolleyes: :p

CiberTHuG
Jun 7th, 2001, 01:18 PM
Sonia's got a point, but... sessions expire (about 20 minutes is the default). Why not have this flag expire. This will require a watchdog routine to turn off expired flags, and it will require touching active ones with each action.

It is just an idea. TIAMTOW.