• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Login/Logout Problem

 
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
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • 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
Scala Eclipse IDE Java
  • 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...
 
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
 
Marshal
Posts: 67286
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Arshad Cs", please check your private messages for an important administrative matter.
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!