Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #502 from spastorino/session_find_and_set

Add find and set methods to Session object
  • Loading branch information...
commit b6fd5bdad25f76b4933099159e7b4e44f9918d1e 2 parents ad80ab7 + 49b2f25
@raggi raggi authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.