0

I am trying to find a way to prevent users from clicking back the browser to the page after they logout and I figured easiest way is to clear the cache so they have to go back to the login page.

I cannot use a scriptlet code to do so, which is what many of the googled suggestions showed. Is there a way to do this via JSTL or HTML?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Beartato327
  • 97
  • 2
  • 6
  • Scriptlet code runs on the server anyway; it is not directly helpful for manipulating the client. For the same reason, JSTL provides nothing directly useful. – John Bollinger Apr 18 '17 at 18:50
  • For its part, HTML has no mechanism to express what you describe, but you can do it by triggering [Javascript embedded in the page](http://stackoverflow.com/questions/8155064/how-to-programmatically-empty-browser-cache). – John Bollinger Apr 18 '17 at 18:53

1 Answers1

-1

use this while you are redirecting to login it will automatically clear cahce

 response.setHeader("Cache-Control","no-cache");   
    response.setHeader("Cache-Control","no-store");  
    response.setDateHeader("Expires", 0);  as "stale"
    response.setHeader("Pragma","no-cache"); 
Ashok Kumar N
  • 573
  • 6
  • 23