vendor/rack/lib/rack/session/pool.rb in relevance-castronaut-0.5.4 vs vendor/rack/lib/rack/session/pool.rb in relevance-castronaut-0.6.0
- old
+ new
@@ -38,10 +38,10 @@
def get_session(env, sid)
session = @mutex.synchronize do
unless sess = @pool[sid] and ((expires = sess[:expire_at]).nil? or expires > Time.now)
@pool.delete_if{|k,v| expiry = v[:expire_at] and expiry < Time.now }
begin
- sid = "%08x" % rand(0xffffffff)
+ sid = generate_sid
end while @pool.has_key?(sid)
end
@pool[sid] ||= {}
end
[sid, session]