Created
May 13, 2010 10:27
-
-
Save cheeyeo/399702 to your computer and use it in GitHub Desktop.
Clearing session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# something trivial but might be helpful if you want to implement clearing the session hash when the user presses the | |
# Back button | |
# used in IQF project when the email contact link on top right of page has to show the title of current page | |
def clear_session | |
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 | |
def my_own_controller_action | |
..... | |
clear_session | |
# rest of code | |
end | |
# or use it in a before_filter | |
# e.g. before_filter :clear_session |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment