b556f04649063162cb2d20a7a5a5c041ebd58eba
1 module ActionController
#:nodoc:
2 module SessionManagement
#:nodoc:
3 def self.included(base
)
10 # Set the session store to be used for keeping the session data between requests.
11 # By default, sessions are stored in browser cookies (<tt>:cookie_store</tt>),
12 # but you can also specify one of the other included stores (<tt>:active_record_store</tt>,
13 # <tt>:mem_cache_store</tt>, or your own custom class.
14 def session_store
=(store
)
15 if store
== :active_record_store
16 self.session_store
= ActiveRecord
::SessionStore
18 @
@session_store = store
.is_a
?(Symbol
) ?
19 Session
.const_get(store
.to_s
.camelize
) :
24 # Returns the session store class currently used.
26 if defined? @
@session_store
33 def session
=(options
= {})
34 self.session_store
= nil if options
.delete(:disabled)
35 session_options
.merge
!(options
)
38 # Returns the hash used to configure the session. Example use:
40 # ActionController::Base.session_options[:secure] = true # session only available over HTTPS
42 @session_options ||= {}
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
)