lib/rack/session/pool.rb in kastner-rack-0.3.171 vs lib/rack/session/pool.rb in kastner-rack-0.3.186
- 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]