This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes Logoff application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Logoff application" Watch "Logoff application" New topic
Author

Logoff application

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
I have done the logoff application by adding the following line


but after I clicked on logoff button its is working fine and redirecting to home page, then after i click on the back button in the browser, the previous functionality is still working. what would I do to prevent the previous functionality? or else is there any chances to lock the previous page?


Thanks,
Kumar
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61448
    
  67

Logging off will do nothing to prevent pages from being served from cache. Be sure to use the techniques described in the JSP FAQ for preventing your pages from being cached.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Shaik Vali
Greenhorn

Joined: Feb 07, 2008
Posts: 22
Hi , this may be related to Cache memory
please try the following code in jsp pages

<% response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires", 0);
response.setHeader("Cache-Control","no-store"); //HTTP 1.1

%>
All the best
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
hi shaik,

do i need to put the above code in all JSPs? only login.jsp?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61448
    
  67

Keep such goo out of the JSP. Investigate the use of a filter.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Logoff application