Originally posted by Pradeep Bhat:
Store a flag in Servlet context object when the admin logs in. When the admin logs out or when session timeout occurs remove the entry. Take of synchroniztion.
Originally posted by Ben Souther:
Then what happens if the Admin user closes his browser or if his/her browser crashes? Will that admin need to wait until the session expires before logging back in?
Originally posted by Pradeep Bhat:
Do you have a better way of implementation?
Originally posted by Pravin Jagan:
Well, i am able to restrict admin login to one at time by saving a flag in the ServletContext. but i got another issue.. how should i handle the situation incase the user (accidently) closes the window without logging out?( as pointed out by Ben)
thanks in advance
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Originally posted by Srinivasa Raghavan:
We used a session listener to update the flag in the DB.
There was a static fame in our application, the html page in the static frame has a unload method, this was used to track , when the user accidently closes the browser. This unload method opens a new window or a jsp, that invalidates the session, the session listener get notified & the flag gets updated.
James Carman, President<br />Carman Consulting, Inc.
Originally posted by Pravin Jagan:
It works fine as long as a admin has logged in and other admin user tries to login. But when a developer user logs in and logs out, an admin user would be able to login eventhough an admin is already logged in
So what i feel is the listener method sessionDestroyed() gets called. I know there is a flaw in my logic, but not able find how to resolve.
In a nutshell, what im doing is, once a admin is logged in , is set a flag in the ServletContext, and no admin would be able to login if the ServletContext attribute has value.a And when the admin logs out, using the sessionlisteners method, i remove the value.
So can anyone help me with this issue.
thanks in advance
You can't have everything. Where would you put it?
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
|