This is mixed into Merb::Controller on framework boot.
:api: private
# File lib/merb-core/dispatch/session.rb, line 59 def self.included(base) # Register a callback to finalize sessions - needs to run before the cookie # callback extracts Set-Cookie headers from request.cookies. base._after_dispatch_callbacks.unshift lambda { |c| c.request.finalize_session } end
A random 32 character string for use as a unique session ID. |
:api: private
# File lib/merb-core/dispatch/session.rb, line 82 def rand_uuid if defined?(SecureRandom) SecureRandom.hex(16) else values = [ rand(0x0010000), rand(0x0010000), rand(0x0010000), rand(0x0010000), rand(0x0010000), rand(0x1000000), rand(0x1000000), ] "%04x%04x%04x%04x%04x%06x%06x" % values end end
session_store<String> |
The type of session store to access. |
The session that was extracted from the request object. |
:api: public
# File lib/merb-core/dispatch/session.rb, line 72 def session(session_store = nil) request.session(session_store) end
Generated with the Darkfish Rdoc Generator 2.