class Merb::SessionContainer

Attributes

session_id[R]

:api: private

Public Class Methods

generate() click to toggle source

Generates a new session ID and creates a new session.

Returns

SessionContainer

The new session.

:api: private

# File lib/merb-core/dispatch/session/container.rb, line 27
def generate
end
inherited(klass) click to toggle source

Register the subclass as an available session store type.

Calls superclass method
# File lib/merb-core/dispatch/session/container.rb, line 16
def inherited(klass)
  self.subclasses << klass.to_s
  super
end
new(session_id) click to toggle source

Parameters

#session_id<String>

A unique identifier for this session.

:api: private

# File lib/merb-core/dispatch/session/container.rb, line 49
def initialize(session_id)
  @_destroy = false
  self.session_id = session_id
end
setup(request) click to toggle source

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

# File lib/merb-core/dispatch/session/container.rb, line 40
def setup(request)
end

Public Instance Methods

clear!() click to toggle source

Destroy the current session - clears data and removes session cookie.

:api: private

# File lib/merb-core/dispatch/session/container.rb, line 80
def clear!
  @_destroy = true
  self.clear
end
finalize(request) click to toggle source

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

# File lib/merb-core/dispatch/session/container.rb, line 74
def finalize(request)
end
regenerate() click to toggle source

Regenerate the session_id.

:api: private

# File lib/merb-core/dispatch/session/container.rb, line 88
def regenerate
end
session_id=(sid) click to toggle source

Assign a new session_id.

Recreates the cookie with the default expiration time. Useful during log in for pushing back the expiration date.

:api: private

# File lib/merb-core/dispatch/session/container.rb, line 60
def session_id=(sid)
  self.needs_new_cookie = (@session_id && @session_id != sid)
  @session_id = sid
end