| Author |
Login/Logout Problem
|
Arshad Cs
Greenhorn
Joined: Sep 04, 2009
Posts: 3
|
|
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
|
------------
ArshadCS
|
 |
Nishan Patel
Ranch Hand
Joined: Sep 07, 2008
Posts: 676
|
|
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.
|
Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
|
 |
Arshad Cs
Greenhorn
Joined: Sep 04, 2009
Posts: 3
|
|
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
Joined: Sep 07, 2008
Posts: 676
|
|
Read below link..
Clear History If User Click Back Button
This topic already discuss with Java ranch...
|
 |
srinivas srinivasmeenavalli
Ranch Hand
Joined: Jul 13, 2008
Posts: 65
|
|
Refer this
webpage
|
 |
Arshad Cs
Greenhorn
Joined: Sep 04, 2009
Posts: 3
|
|
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
Joined: Jan 10, 2002
Posts: 56168
|
|
|
"Arshad Cs", please check your private messages for an important administrative matter.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Login/Logout Problem
|
|
|