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
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.
39 40 41 42 |
# File 'lib/merb-core/dispatch/session/container.rb', line 39 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 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
Generates a new session ID and creates a new session.
Returns
- SessionContainer
-
The new session.
23 24 |
# File 'lib/merb-core/dispatch/session/container.rb', line 23 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
Parameters
- request<Merb::Request>
-
The Merb::Request that came in from Rack.
Returns
- SessionContainer
-
a SessionContainer. If no sessions were found,
a new SessionContainer will be generated.
32 33 |
# File 'lib/merb-core/dispatch/session/container.rb', line 32 def setup(request) end |
Instance Method Details
#clear! ⇒ Object
Destroy the current session - clears data and removes session cookie.
64 65 66 67 |
# File 'lib/merb-core/dispatch/session/container.rb', line 64 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.
60 61 |
# File 'lib/merb-core/dispatch/session/container.rb', line 60 def finalize(request) end |
#regenerate ⇒ Object
Regenerate the session_id.
70 71 |
# File 'lib/merb-core/dispatch/session/container.rb', line 70 def regenerate end |