lib/tynn/session.rb in tynn-1.2.0 vs lib/tynn/session.rb in tynn-1.3.0

- old
+ new

@@ -60,13 +60,15 @@ # ) # module Session # Internal: Configures Rack::Session::Cookie middleware. def self.setup(app, options = {}) - defaults = { secure: app.settings[:ssl] } + if app.settings[:ssl] + options = { secure: true }.merge(options) + end - app.use(Rack::Session::Cookie, defaults.merge(options)) + app.use(Rack::Session::Cookie, options) end module InstanceMethods # Public: Returns the session hash. # @@ -76,10 +78,10 @@ # # session[:foo] = "foo" # session[:foo] # => "foo" # def session - return env["rack.session".freeze] + return req.session end end end end