class ActionDispatch::Request::Session

def update(hash)

# => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"}
session.to_hash

# => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"}
session.update({ "foo" => "bar" })

# => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2"}
session.to_hash

Updates the session with given Hash.
def update(hash)
  unless hash.respond_to?(:to_hash)
    raise TypeError, "no implicit conversion of #{hash.class.name} into Hash"
  end
  load_for_write!
  @delegate.update hash.to_hash.stringify_keys
end