lib/rack/session/abstract/id.rb in rack-session-0.1.0 vs lib/rack/session/abstract/id.rb in rack-session-0.2.0
- old
+ new
@@ -9,10 +9,12 @@
require 'rack/constants'
require 'rack/request'
require 'rack/response'
+require_relative '../constants'
+
module Rack
module Session
class SessionId
@@ -413,13 +415,12 @@
end
# Sets the cookie back to the client with session id. We skip the cookie
# setting if the value didn't change (sid is the same) or expires was given.
- def set_cookie(request, res, cookie)
+ def set_cookie(request, response, cookie)
if request.cookies[@key] != cookie[:value] || cookie[:expires]
- res.set_cookie_header =
- Utils.add_cookie_to_header(res.set_cookie_header, @key, cookie)
+ response.set_cookie(@key, cookie)
end
end
# Allow subclasses to prepare_session for different Session classes