This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes stop multipe login with same user name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "stop multipe login with same user name" Watch "stop multipe login with same user name" New topic
Author

stop multipe login with same user name

gevarghese varghese
Greenhorn

Joined: Apr 18, 2007
Posts: 4
hai,
I am doing a struts application I am bit new to this framework.
I have a requirement which is like this----

whenever a user is logging and without logging out he opens a new browser
with same user name and password OR in a different system he agian tries to login then the previously logged session should be deactivte.

For example just like yahoo mail.
whan a user logs in twice with same id and password more than once except the last logged session all previous sessions are deavtivated.

HOW TO DO THAT IN STRUTS PLEASE HELP ME ON THIS CASE
Oscar Gonzalez
Ranch Hand

Joined: Mar 28, 2006
Posts: 63
Save the username in the context (application)object of the application and make your page search for that user everytime you create a Session with a Listener.

If you use Struts make your Action extend of a BaseAction and check for the username in that one.
[ April 20, 2007: Message edited by: Oscar Gonzalez ]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

Samuel,
Other places to put the check include in a servlet filter or by extending the Struts RequestProcessor.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
gevarghese varghese
Greenhorn

Joined: Apr 18, 2007
Posts: 4
Oscar Gonzalez ,
thank's
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: stop multipe login with same user name
 
Similar Threads
session variable
Single login for a Particular url
multiple login with same user name and password
login mechanism using JAVA
enable multiple users login using the same browser in diffrent tabs