Browse files

Merge pull request #502 from spastorino/session_find_and_set

Add find and set methods to Session object
  • Loading branch information...
2 parents ad80ab7 + 49b2f25 commit b6fd5bdad25f76b4933099159e7b4e44f9918d1e @raggi raggi committed Feb 5, 2013
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 b6fd5bd

Please sign in to comment.