• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Login/Logout Problem

 
Arshad Cs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used a HTML page to accept username and password. The params are accepted by a servlet that checks them. If accepted, it redirects to servlet Home otherwise redirects to an errorpage.
On successful login the values are put in session so that it can be displayed in all other pages.

Now, the problem part. When logout is clicked, the user should logout ... i used session.invalidate() to do this.... and then redirect to login page again.......but if i click the Back button in browser. . . it works as usual

Please suggest something
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arshad,

welcome to Java Ranch

your session is already invalidated. But when you click on back it shows last page you access, means at that page you are not check for session. So make always check for session, if session available or not. If session available process for further otherwise redirect to login page.
 
Arshad Cs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for prompt reply....

is that any method to clear history... so that the "back" button doesn't work at all ?
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read below link..

Clear History If User Click Back Button

This topic already discuss with Java ranch...
 
srinivas srinivasmeenavalli
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer this
webpage
 
Arshad Cs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used the following code.... username and password are both checked to be admin/admin




Please correct me where i get wrong
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Arshad Cs", please check your private messages for an important administrative matter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic