This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Servlets and the fly likes can we invalidate the session of  second user ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "can we invalidate the session of  second user ?" Watch "can we invalidate the session of  second user ?" New topic

can we invalidate the session of second user ?

shyam ji gautam
Ranch Hand

Joined: Sep 17, 2011
Posts: 49
Dear all
First of all i want to tell the scenario actually i am making a application in which there is one user let us suppose User A is admin he will handle the admin part.

so let us suppose if any user B log in then for that user B in databse we set a flag which value is : N (AFTER LOGIN )
when user B logout this flag will goes to ;Y

so if user B is continue surfing the website at t=0 then that time if admin (user A ) Set the flag to Y for userb so is it possible for USER B goes on to the login page .

means can one sesssion interrupt (logout ) another user of different session id ?


Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3360

Didn't you perhaps mention a solution yourself
Use an intercept filter that checks the whether flag of the current user is 'N'. When it isn't, the user should be redirected to the login page.

Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
I agree. Here's the link:
subject: can we invalidate the session of second user ?