• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Single login for a Particular url

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

I'm required to restrict a user from signing into the same URL second time.
i.e., when a user A has logged in to the application with user name "A",he can not log in with other user name with in the same browser.
I had an idea like, on load of the login page i will check for the session, if the session is null direct to the login page else, to the home page.
But how will i be able to check the session in login page?

Thanks in advance
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Cookie or Database flag
 
sindhu sheela
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i fear if you got my question wrong.
I was trying to say that given a client only one user can login to the application with in the same browser.If he visits the same URL in a new tab or new window of the same browser he should be directed to home page directly need not login again,i.e.,He will not be able to view login page again so their is no chance for him to log in with a different user name.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since it is a java based web application, implementing jaas will solve this issue once and for all.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Consider you are using session in your code, then whenever a new window opened that would have new session... so you can solve a part of the problem by this....
when going for a new tab try the same.... session and cookie combined will give you a answer...

reply how it works....
 
Charbel Keyrouz
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to say but if you a open a new window from an existing window it will still be in the same session, same thing goes when you open another tab.

I think the solution resides in setting in the session an array or a list of any type containing all the visited URLs by the user.

At the beginning of each page that is called you should check if this url was visited or not, if not let him do whatever he wants otherwise force redirection to the home page.

Remember that a session ID will remain the same as long you did not log out or session did not expire and you are in the same browser not matter how many tabs you open or how many windows you open.
 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic