• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Prevent multiple login to web app

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All,

I have to prevent multiple user logins to my web application developed in Struts running in tomcat.

This is the situation:
User A logs in application and proceeds to application page. Now if User A opens another IE window and tries to login, he shouldnt be allowed to login again. How can I achieve this ?

I tried using istokenvalid,savetoken etc. But this approach doesnt work if the user opens a new IE from task bar and also refresh also fails here[I understand its meant to hide refresh capability].
How else can i achieve this ?

Thanks,Atul
[ March 29, 2007: Message edited by: Atul Mishra ]
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Atul, Did you search javaranch for this question? It's been asked before. In short you don't have easy way. You either to have use some sort of persistence to store the active sessions and search them before creating a new session or you can use JMX to query the active sessions (which will be costly when compared to persistence technique). If you search further you will find more details. Struts as far as I know doesn't provide this logic. This is more of JSP question.
[ March 26, 2007: Message edited by: Purushothaman Thambu ]
 
Atul Mishra
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.. I will search in JSP forum,

Also moderators.... can anyone please move this to JSP Forum..

Thanks
 
Atul Mishra
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All,

I read about this in Javaranch archives.

Basically I have different scenarios:
1, User logegd in and opens a new window from "windows task bar", thereby opening a new sessionid. I tried the approach of using Maps here. it works. Is that the preferred approach here or using HttpSessionListener is the preferred approach ?

I need some more links with using httpsessionlistener, my serach didnt give me much

How about cntrl+n or file-new-open window.
I have login.jsp which takes users to second page-results.jsp, In this page "refresh" should be available, but cntrl+n shouldnt be ? Can we handle it ?

I read a post of using timestamps with cntrl+n but that can catch "Refresh" button also. So please suggest some help

Thanks
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Atul Mishra:
Thanks.. I will search in JSP forum,

Also moderators.... can anyone please move this to JSP Forum..

Thanks



A.) You'll find more on this subject in the Servlets forum than anywere else on this site. (Perform a search with my name and "reliable" as keywords)

B.) Since you're asking about a Struts specific solution, our Struts forum would be the best place to move this thread.

Let me know if you want this thread moved to Struts.
 
Atul Mishra
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben,

I originally posted this in Struts, I dont need a strts specific solution, Its a general solution for any jsp/servlets. It would be nice to remove "struts" from my heading also.

Thanks,
Atul
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Atul Mishra:
It would be nice to remove "struts" from my heading also.



Then go ahead. You can edit your own entries by clicking the .
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic