Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When a session ends I have to start a final process, but how? 1

Status
Not open for further replies.

freiheit

Programmer
Oct 4, 2000
8
DE
Hi,

I need your help, because i have no idea how to develop this:

A user logs in. If it is a good login I create a session variable and have to set lock flag on him in the database, because he should not be able to log in in another certain application which uses the same login and database.

So if this lock flag is set in the database he cannot login to the other application. That's good.

If he is ready with working on the webapplication he can use the logoff button and I'm able to clear the session and the lock flag from the database.

Now to the problem:

But if he does not use the logoff button, perhaps he closes the browser or takes a link, I'm not able to delete the flag. So he wouldn't be able to login to any application anymore at all. That's not so good.

Can I call a process after a session variable ends which deletes the flag from the database?

Thanks for help.
Marcus

 
Instead of a on/off locking variable, you could set it as a date/time variable, and update it every time they access a page (keeping the session alive). Then when someone tries logging in to either application, you could check to see if that variable is older than the session timeout. In other words, if a session times out after twenty minutes, it would be safe to let someone log in if that date/time value represents a time earlier than 20 minutes ago...

Another way to do this may be to go ahead and let people log in to either application, but kill any possible sessions that are currently active...??? (Not quite sure how to do that, though....)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top