This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Spring and the fly likes session ID Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "session ID" Watch "session ID" New topic
Author

session ID

deepak mundhada
Greenhorn

Joined: May 10, 2012
Posts: 5
I am developing a product in which there is a ADMIN who can create number of USERS by giving their profile details and password too. these USER can perform certain tasks on this application by logging in from any computer.

Problem -:
If ADMIN deletes any USER from the same application on any computer and if this USER have logged in on any other computer before deletion performed, so even after account deletion , USER is able to perform all operations until he logs out once.

Thought -:
If ADMIN could invalidate the session when he deleting his account, then could solve. But how to know session of this logged in & getting deleted USER???

If you have understood, please reply me soon...............
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1282

One option is to use SessionRegistry

From that you can get the SessionInformation

and call expireNow()

from the API docs

Sessions have three states: active, expired, and destroyed. A session can that is invalidated by session.invalidate() or via Servlet Container management is considered "destroyed". An "expired" session, on the other hand, is a session that Spring Security wants to end because it was selected for removal for some reason (generally as it was the least recently used session and the maximum sessions for the user were reached). An "expired" session is removed as soon as possible by a Filter.


[How To Ask Questions][Read before you PM me]
deepak mundhada
Greenhorn

Joined: May 10, 2012
Posts: 5
Thanks for reply!

But would i be able to stop that USER having logged in to the system when ADMIN at same time deleting that USER???
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1282

Well when you delete the user you would get his active session if it exists and expire it. This should cause him to be redirected to the login page.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session ID
 
Similar Threads
Logging out in Ctrl-N window
session problem in struts 2 application
how we can do that when one user is log successfully
Two Web App communicating problem
Issue in session manegement