In my opinion a slightly different approach such as the folowing could be
better.
When a user successfully logs in, create a variable and store it in the
users session.
When you want to log out the user just remove the variable from the users
session and be sure to keep a check on every page for this variable, which
you want the user to be logged in before accessing.
If you donot find the variable just direct the user to the login page.
In case you are employing a MVC architecture your job could be further
simplified by just keeping the check for the variable in the Controller.
Assume this helps.
Have a nice day.
With regards,
Sachin S. Khanna
http://www.emailanorder.com
----- Original Message -----
From: Chiara Berti <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 13, 2001 10:05 PM
Subject: Logout problem...
> Hy,
> I have a problem with Jsp....I have an application that logs in the user
by a servlet (called by Login.jsp); in this servlet I do:
>
> > sessione = req.getSession(true);
>
> and then I call some Jsp...when a user logs out I call the same login
servlet; in this servlet I do:
>
> > sessione.invalidate();
>
> and redirect the user to Login.jsp.
> Now if the user press the browser back button my application runs..why???
> I invalidate the session...and I want that my application doesn' run
without logging in.
> Please help me...
>
> Thanks,
> Chiara
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets