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

Preserving Login Information

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have question about "Preserving Login Information" or "Passing Authentication Information to all other pages".
Q1.
once a user has logged in, and we have confirmed that the loging is correct, How do we keep track this information for all future user request that we have validate this user and this is a valid user. what is the best and way to achieve this task?
Just to let know that i am using Programmatic authentication( one way Encryption ) for my login authentication.
Q2.
Once user leave the application , lets say user opens yahoo.com without
clicking on logout link on the application. how can we prompt user for login/password, if he/she try to use application using "Back" button?
If someone can help me or point me to a example where i can see how do we solve or implement both the problem? please do help me because i have to build this application and give a demo ASAP ( not fully but loging part).

waiting for help and thanks for help.
vivek
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
vivek_saxena
Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
For your first question you can use a session variable to store th users login name or just a Boolean. Then on all of your pages just check this variable to make sure it has a name in it or the Boolean is true. When they hit your logout button jst set the variable to "" or false depending on what you use. It will alos get set to null if the session times out.
As far as I know there is no easy, reliable way to detect when a user leaves your pages. Someone else here might ave mroe input on that.
 
Vivek Saxena
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I did change my name.
could someone please help me with my problems in detail or point me to example?
please do help me.
thanks
 
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi vivek,
I generally store some sort of indication that the user is logged on in the session. The user's Id generally.
To secure your pages from being accessed thro the browser history, you should try 'expiring' them, but this works differently for different browsers and I'm not totally sure. It's something I've been meaning to find out about but never got around to.
I used to do it with ASP when I was a Microsoftie - you could check out this article and see if it gives you anything you could translate to java:
http://www.learnasp.com/learn/cachenomore.asp
HTH
Adam
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic