After a user logs out, if they hit the back button, they can go back to the last page they were on before logging out.
The app I am working on will often be used on
Yes, You have to use the http headers to instruct browser not to cache the page. This page () from OWASP contains the information about how to do this.
As per the above article you can set the following header to instruct browser not to cache the page:
HTTP/1.1:
Cache-Control: no-cache
or
HTTP/1.0:
Pragma: no-cache
Expires: <past date or illegal value (e.g., 0)>
Hope this helps.
Use the below code in application controller .. it works for me. Hope this will help you. Thank you!!
code
before_filter :set_cache_buster
def set_cache_buster
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
Being on Rails, you can easly setup everything placed in the public
folder with an aggressive cache, and cherry-pick what else can be safetly cached, like the public "about" page.
You should set Cache-Control: no-cache
to prevent the browser to cache HTML pages, XML, JSON containing sensitive informations (basically anything that is accessible only with a proper login) and set a more aggressive cache for static assets like css and images.