| Module | ActionController::SessionManagement::ClassMethods |
| In: |
vendor/rails/actionpack/lib/action_controller/session_management.rb
|
# File vendor/rails/actionpack/lib/action_controller/session_management.rb, line 45
45: def session(*args)
46: ActiveSupport::Deprecation.warn(
47: "Disabling sessions for a single controller has been deprecated. " +
48: "Sessions are now lazy loaded. So if you don't access them, " +
49: "consider them off. You can still modify the session cookie " +
50: "options with request.session_options.", caller)
51: end
# File vendor/rails/actionpack/lib/action_controller/session_management.rb, line 33
33: def session=(options = {})
34: self.session_store = nil if options.delete(:disabled)
35: session_options.merge!(options)
36: end
Returns the hash used to configure the session. Example use:
ActionController::Base.session_options[:secure] = true # session only available over HTTPS
# File vendor/rails/actionpack/lib/action_controller/session_management.rb, line 41
41: def session_options
42: @session_options ||= {}
43: end
Set the session store to be used for keeping the session data between requests. By default, sessions are stored in browser cookies (:cookie_store), but you can also specify one of the other included stores (:active_record_store, :mem_cache_store, or your own custom class.
# File vendor/rails/actionpack/lib/action_controller/session_management.rb, line 14
14: def session_store=(store)
15: if store == :active_record_store
16: self.session_store = ActiveRecord::SessionStore
17: else
18: @@session_store = store.is_a?(Symbol) ?
19: Session.const_get(store.to_s.camelize) :
20: store
21: end
22: end