Skip to content

Commit

Permalink
disable caching to disable the back button when the user logs out (fo…
Browse files Browse the repository at this point in the history
…rce reload)
  • Loading branch information
ZeroPointEnergy committed Jun 25, 2014
1 parent b0ebe66 commit 8778736
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ApplicationController < ActionController::Base
before_filter :validate, :except => [:login, :authenticate, :logout]
before_filter :prepare_menu
before_filter :set_locale
before_filter :set_cache_headers


protected
Expand Down Expand Up @@ -82,4 +83,10 @@ def prepare_menu
end
end

def set_cache_headers
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

end

0 comments on commit 8778736

Please sign in to comment.