lib/rack/session/abstract/id.rb
def commit_session(env, status, headers, body)
          session = env['rack.session']
          options = env['rack.session.options']
          session_id = options.delete :id

          unless set_session(session_id, session, options)
            env["rack.errors"].puts("Warning! #{self.class.name} failed to save session. Content dropped.")
            [status, headers, body]
          else
            cookie = Hash.new
            cookie[:value] = session_id
            cookie[:expires] = Time.now + options[:expire_after] unless options[:expire_after].nil?
            response = Rack::Response.new(body, status, headers)
            response.set_cookie(@key, cookie.merge(options))
            response.to_a
          end
        end
# Acquires the session from the environment and the session id from
# the session options and passes them to #set_session. It then
# proceeds to set a cookie up in the response with the session's id.
Acquires the session from the environment and the session id from
the session options and passes them to #set_session. It then
proceeds to set a cookie up in the response with the session's id.
Acquires the session from the environment and the session id from the session options and passes them to #set_session . It then proceeds to set a cookie up in the response with the session ' s id .
def commit_session(env, status, headers, body)
          session = env['rack.session']
          options = env['rack.session.options']
          session_id = options.delete :id
          unless set_session(session_id, session, options)
            env["rack.errors"].puts("Warning! #{self.class.name} failed to save session. Content dropped.")
            [status, headers, body]
          else
            cookie = Hash.new
            cookie[:value] = session_id
            cookie[:expires] = Time.now + options[:expire_after] unless options[:expire_after].nil?
            response = Rack::Response.new(body, status, headers)
            response.set_cookie(@key, cookie.merge(options))
            response.to_a
          end
        end
def commit_session ( env , status , headers , body ) session = env [ 'rack.session' ] options = env [ 'rack.session.options' ] session_id = options . delete :id unless set_session ( session_id , session , options ) env [ "rack.errors" ] . puts ( "Warning! #{self.class.name} failed to save session. Content dropped." ) [ status , headers , body ] else cookie = Hash . new cookie [ :value ] = session_id cookie [ :expires ] = Time . now + options [ :expire_after ] unless options [ :expire_after ] . nil? response = Rack :: Response . new ( body , status , headers ) response . set_cookie ( @key , cookie . merge ( options ) ) response . to_a end end
Acquires the session from the environment and the session id from
the session options and passes them to #set_session.
Acquires the session from the environment and the session id from the session options and passes them to #set_session .
env
status
headers
body