2

I am using struts framework, after log out when i pressed browser back button it is going to last opened page. How to send it to log in page?

Actually i want solution in java not in javascript.

Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
D S
  • 1,311
  • 2
  • 8
  • 6
  • possible duplicate of [Prevent user from going back to the previous secured page after logout](http://stackoverflow.com/questions/4194207/prevent-user-from-going-back-to-the-previous-secured-page-after-logout) – BalusC May 24 '12 at 04:27

2 Answers2

1

I believe you must be having a security filter to intercept all incoming requests. If not you need to have one to authenticate user session. Here on failure you can forward to login page.

Also check if the page is rendered from browser cache. If so you can set no-cache in the header of the JSP.

<%
   response.setHeader( "Pragma", "no-cache" );
   response.setHeader( "Cache-Control", "no-cache" );
   response.setDateHeader( "Expires", 0 );
%>
Subir Kumar Sao
  • 8,171
  • 3
  • 26
  • 47
-1

If you have invalidated (session.invalidate();) your session through logout, just in action control you forward your request to the jsp page you want. Once session is broken if you press back it won't go to the same page I think.

Adam Lear
  • 38,111
  • 12
  • 81
  • 101
Vishal Sharma
  • 112
  • 2
  • 9
  • 1
    Can you please try to form normal sentences and words? You are writing in fasttalk/SMS/chat style which is hard to understand for anyone whose native tongue is not English. Thank you. – BalusC May 24 '12 at 04:28