You are here: Browse Railsplugins Sliding Session Timeout
By default, sessions in Rails expire at a fixed time from the moment they are created. This plugin lets you configure your sessions to expire in a sliding window, a fixed time from the last page view.
Usage: # the macro for use in controllers sliding_session_timeout seconds [, upon_expiry_function]
'seconds' is the time in seconds for a session to live
'upon_expiry_function' is an optional method to call when a session dies
- ActionController::Base.reset_session will be called upon session expiry.
- If an expiry_function was provided, the call to reset_session will happen
after the call to the expiry_function to preserve session data for the
expiry_function.
Examples: # in app/controllers/application.rb
def logout
# do stuff here for logout
end
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly