Re: Log out problem
Aasim <[email protected]>
| Newsgroups | gmane.comp.java.sun.servlet |
|---|---|
| Message-ID | <[email protected]> |
Hi,
In order to not cache the information, I set the following HTTP headers:
response.setHeader("Cache-Control", "no-cache,no-store,must-revalidate");
response.setHeader("Pragma", "no-cache");
I set these headers at the beginning of my doPost() method. Still the same thing is happening. When I click the back button on my browser, I get the previous page in the session instead of the login page.
After a user logs out and clicks the "back" button, I want him to login again to access the site.
Is there something I am doing wrong?
Thanks for any help in advance!
Sincerely,
--Andy.
Gareth Jones <[email protected]> wrote:
As Victor says you could stop the jsp from being cached especially if the jsp performs some process which you dont want to accidentally repeat. But also the JSP will create a new session by default unless you specify otherwise. You can check for a new session (session.isNew()) or alternatively set the jsp not to create a session (<%@ page session="false"%>) then check that a session exists.
>From: "Leung, Victor"
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java Servlet API Technology." >To: [email protected] >Subject: Re: Log out problem >Date: Wed, 5 Mar 2003 17:32:48 -0500 > >any chance you are reading from cache when you click on the back button? >Also, make sure you put no-cache or no-store in the headers. > >-----Original Message----- >From: Aasim [mailto:[email protected]] >Sent: Wednesday, March 05, 2003 5:19 PM >To: [email protected] >Subject: Log out problem > > > >Dear Servlet-Interest users, > > >I have an online ordering application and I am having problems logging out. >Once a user has placed an order and he clicks on the Logoff button, I call a >servlet where I destroy the session and redirect the user to a new page with >the message that he has logged out successfully. But, when I hit the back >button on the browser, it again takes me to the previous page. I want the >user to go to the login page when he hits the back butto
n on the browser and >force him to login again to access any of the pages, instead of the previous >page in his session. > > >How can I achieve this functionality? >Thanks for any help in advance! > >Sincerely, > > >--Andy. > > > > > > > > > > _____ > >Do you Yahoo!? >Yahoo! >Tax Center - forms, calculators, tips, and more >
---------------------------------
Stay in touch with absent friends. Download MSN Messenger for FREE! ___________________________________________________________________________ To unsubscribe, send email to [email protected] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more