I have a log in page where user enters email and password and then the user is redirected to home page, but when i press the back button it takes me back to the log in page. How do i prevent that from happening in rails 3?
Add this to the LoginController (controller which is using for login)
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
This will clear the browser history
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments