Skip to content
This repository
Browse code

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
James Tucker authored February 05, 2013

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  lib/rack/session/abstract/id.rb
8  lib/rack/session/abstract/id.rb
@@ -24,6 +24,14 @@ class SessionHash
24 24
         include Enumerable
25 25
         attr_writer :id
26 26
 
  27
+        def self.find(env)
  28
+          env[ENV_SESSION_KEY]
  29
+        end
  30
+
  31
+        def self.set(env, session)
  32
+          env[ENV_SESSION_KEY] = session
  33
+        end
  34
+
27 35
         def self.set_options(env, options)
28 36
           env[ENV_SESSION_OPTIONS_KEY] = options.dup
29 37
         end

0 notes on commit b6fd5bd

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