Rails ( set_no_cache method) Cannot disable browser caching in Safari and Opera
问题 After using Devise for my authentication, I found that there was a security hole in that, after the user logs out, the session variables are preserved. This allows anyone to press the back button and access the logged in user's previous screen. I looked at these posts Num 1 Num 2 Num 3 I added these lines to my application_controller before_filter :set_no_cache def set_no_cache response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" response.headers["Pragma"] =