Class: Merb::SessionContainer
- Defined in:
- lib/merb-core/dispatch/session/container.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#needs_new_cookie ⇒ Object
:api: private.
-
#session_id ⇒ Object
:api: private.
Class Method Summary collapse
-
.generate ⇒ Object
Generates a new session ID and creates a new session.
-
.inherited(klass) ⇒ Object
Register the subclass as an available session store type.
-
.setup(request) ⇒ Object
Parameters request<Merb::Request>:: The Merb::Request that came in from Rack.
Instance Method Summary collapse
-
#clear! ⇒ Object
Destroy the current session - clears data and removes session cookie.
-
#finalize(request) ⇒ Object
Teardown and/or persist the current session.
-
#initialize(session_id) ⇒ SessionContainer
constructor
Parameters session_id<String>:: A unique identifier for this session.
-
#regenerate ⇒ Object
Regenerate the session_id.
Constructor Details
#initialize(session_id) ⇒ SessionContainer
Parameters
- session_id<String>
-
A unique identifier for this session.
:api: private
49 50 51 52 |
# File 'lib/merb-core/dispatch/session/container.rb', line 49 def initialize(session_id) @_destroy = false self.session_id = session_id end |
Instance Attribute Details
#needs_new_cookie ⇒ Object
:api: private
11 12 13 |
# File 'lib/merb-core/dispatch/session/container.rb', line 11 def @needs_new_cookie end |
#session_id ⇒ Object
:api: private
9 10 11 |
# File 'lib/merb-core/dispatch/session/container.rb', line 9 def session_id @session_id end |
Class Method Details
.generate ⇒ Object
Generates a new session ID and creates a new session.
Returns
- SessionContainer
-
The new session.
:api: private
27 28 |
# File 'lib/merb-core/dispatch/session/container.rb', line 27 def generate end |
.inherited(klass) ⇒ Object
Register the subclass as an available session store type.
16 17 18 19 |
# File 'lib/merb-core/dispatch/session/container.rb', line 16 def inherited(klass) self.subclasses << klass.to_s super end |
.setup(request) ⇒ Object
Parameters
- request<Merb::Request>
-
The Merb::Request that came in from Rack.
Notes
If no sessions were found, a new SessionContainer will be generated.
Returns
- SessionContainer
-
a SessionContainer.
:api: private
40 41 |
# File 'lib/merb-core/dispatch/session/container.rb', line 40 def setup(request) end |
Instance Method Details
#clear! ⇒ Object
Destroy the current session - clears data and removes session cookie.
:api: private
80 81 82 83 |
# File 'lib/merb-core/dispatch/session/container.rb', line 80 def clear! @_destroy = true self.clear end |
#finalize(request) ⇒ Object
Teardown and/or persist the current session.
If @_destroy is true, clear out the session completely, including removal of the session cookie itself.
Parameters
- request<Merb::Request>
-
The Merb::Request that came in from Rack.
:api: private
74 75 |
# File 'lib/merb-core/dispatch/session/container.rb', line 74 def finalize(request) end |
#regenerate ⇒ Object
Regenerate the session_id.
:api: private
88 89 |
# File 'lib/merb-core/dispatch/session/container.rb', line 88 def regenerate end |