Class: Merb::SessionContainer
- Defined in:
- lib/merb-core/dispatch/session/container.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#needs_new_cookie ⇒ Object
Returns the value of attribute needs_new_cookie.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
Class Method Summary collapse
-
.generate ⇒ Object
private
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
private
Parameters request<Merb::Request>:: The Merb::Request that came in from Rack.
Instance Method Summary collapse
-
#clear! ⇒ Object
private
Destroy the current session - clears data and removes session cookie.
-
#finalize(request) ⇒ Object
private
Teardown and/or persist the current session.
-
#initialize(session_id) ⇒ SessionContainer
constructor
private
Parameters session_id<String>:: A unique identifier for this session.
-
#regenerate ⇒ Object
private
Regenerate the session_id.
Constructor Details
#initialize(session_id) ⇒ SessionContainer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parameters
- session_id<String>
-
A unique identifier for this session.
47 48 49 50 |
# File 'lib/merb-core/dispatch/session/container.rb', line 47 def initialize(session_id) @_destroy = false self.session_id = session_id end |
Instance Attribute Details
#needs_new_cookie ⇒ Object
Returns the value of attribute needs_new_cookie.
9 10 11 |
# File 'lib/merb-core/dispatch/session/container.rb', line 9 def @needs_new_cookie end |
#session_id ⇒ Object
Returns the value of attribute session_id.
8 9 10 |
# File 'lib/merb-core/dispatch/session/container.rb', line 8 def session_id @session_id end |
Class Method Details
.generate ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Generates a new session ID and creates a new session.
Returns
- SessionContainer
-
The new session.
25 26 |
# File 'lib/merb-core/dispatch/session/container.rb', line 25 def generate end |
.inherited(klass) ⇒ Object
Register the subclass as an available session store type.
14 15 16 17 |
# File 'lib/merb-core/dispatch/session/container.rb', line 14 def inherited(klass) self.subclasses << klass.to_s super end |
.setup(request) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
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.
38 39 |
# File 'lib/merb-core/dispatch/session/container.rb', line 38 def setup(request) end |
Instance Method Details
#clear! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Destroy the current session - clears data and removes session cookie.
78 79 80 81 |
# File 'lib/merb-core/dispatch/session/container.rb', line 78 def clear! @_destroy = true self.clear end |
#finalize(request) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
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.
72 73 |
# File 'lib/merb-core/dispatch/session/container.rb', line 72 def finalize(request) end |
#regenerate ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Regenerate the session_id.
86 87 |
# File 'lib/merb-core/dispatch/session/container.rb', line 86 def regenerate end |