Class: CGI::Session
- Defined in:
- lib/action_controller/cgi_ext/session.rb,
lib/action_controller/session/drb_store.rb,
lib/action_controller/session/active_record_store.rb
Overview
-
Expose the CGI instance to session stores.
-
Don’t require ‘digest/md5’ whenever a new session id is generated.
Defined Under Namespace
Classes: ActiveRecordStore, CookieStore, DRbStore, PStore
Instance Attribute Summary collapse
-
#cgi ⇒ Object
readonly
Make the CGI instance available to session stores.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#dbman ⇒ Object
readonly
Returns the value of attribute dbman.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cgi, options = {}) ⇒ Session
constructor
A new instance of Session.
- #initialize_without_cgi_reader ⇒ Object
-
#model ⇒ Object
Return this session’s underlying Session instance.
Constructor Details
#initialize(cgi, options = {}) ⇒ Session
Returns a new instance of Session.
17 18 19 20 |
# File 'lib/action_controller/cgi_ext/session.rb', line 17 def initialize(cgi, = {}) @cgi = cgi initialize_without_cgi_reader(cgi, ) end |
Instance Attribute Details
#cgi ⇒ Object (readonly)
Make the CGI instance available to session stores.
14 15 16 |
# File 'lib/action_controller/cgi_ext/session.rb', line 14 def cgi @cgi end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/action_controller/session/active_record_store.rb', line 7 def data @data end |
#dbman ⇒ Object (readonly)
Returns the value of attribute dbman.
15 16 17 |
# File 'lib/action_controller/cgi_ext/session.rb', line 15 def dbman @dbman end |
Class Method Details
.generate_unique_id(constant = nil) ⇒ Object
:nodoc:
9 10 11 |
# File 'lib/action_controller/cgi_ext/session.rb', line 9 def self.generate_unique_id(constant = nil) ActiveSupport::SecureRandom.hex(16) end |
Instance Method Details
#initialize_without_cgi_reader ⇒ Object
16 |
# File 'lib/action_controller/cgi_ext/session.rb', line 16 alias_method :initialize_without_cgi_reader, :initialize |
#model ⇒ Object
Return this session’s underlying Session instance. Useful for the DB-backed session stores.
10 11 12 |
# File 'lib/action_controller/session/active_record_store.rb', line 10 def model @dbman.model if @dbman end |