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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

only allow one user at a time

Status
Not open for further replies.

transtech

Programmer
Aug 21, 2001
23
0
0
US
Hi all,

I am writing a jsp application now that required only one user to use the session at a time, if anyone knows how to do it, can you please tell me.

Thanks in Advance,

evan
 
You could use a SessionListener (Servlet 2.3) and set a flag in memory when a Session is created and uncheck the flag when the Session is destoryed. Before creating a new Session check your flag to see if anyone else is using the application. This will ensure at most one user.

Make sure that the check and set of your flag is in a single synchronized method to remove threading issues.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top