Skip to content
Browse files

Add find and set methods to Session object

  • Loading branch information...
1 parent 42b11a7 commit 49b2f25f709b40630d934b0a54830ddc21e2e56a @spastorino spastorino committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/rack/session/abstract/id.rb
View
8 lib/rack/session/abstract/id.rb
@@ -24,6 +24,14 @@ class SessionHash
include Enumerable
attr_writer :id
+ def self.find(env)
+ env[ENV_SESSION_KEY]
+ end
+
+ def self.set(env, session)
+ env[ENV_SESSION_KEY] = session
+ end
+
def self.set_options(env, options)
env[ENV_SESSION_OPTIONS_KEY] = options.dup
end

0 comments on commit 49b2f25

Please sign in to comment.
Something went wrong with that request. Please try again.