From: "Ara.T.Howard" Date: 2005-09-14T12:23:52+09:00 Subject: Re: [BUG/PATCH] cgi/session.rb, cgi/session/pstore.rb On Wed, 14 Sep 2005, Ara.T.Howard wrote: CGI::Session::MemoryStore and CGI::Session::PStore suffer from same issue... updated patches (in the right order this time): --- ./cgi/session.rb.org 2005-09-13 20:52:14.000000000 -0600 +++ ./cgi/session.rb 2005-09-13 21:13:22.000000000 -0600 @@ -244,7 +244,7 @@ # end # def initialize(request, option={}) - @new_session = false + @new_session = nil session_key = option['session_key'] || '_session_id' session_id = option['session_id'] unless session_id @@ -381,10 +381,11 @@ md5 = Digest::MD5.hexdigest(id)[0,16] @path = dir+"/"+prefix+md5+suffix unless File::exist? @path - unless session.new_session + unless session.new_session.nil? raise CGI::Session::NoSession, "uninitialized session" end @hash = {} + update end end @@ -451,7 +452,7 @@ def initialize(session, option=nil) @session_id = session.session_id unless GLOBAL_HASH_TABLE.key?(@session_id) - unless session.new_session + unless session.new_session.nil? raise CGI::Session::NoSession, "uninitialized session" end GLOBAL_HASH_TABLE[@session_id] = {} --- ./cgi/session/pstore.rb.org 2005-09-13 21:07:52.000000000 -0600 +++ ./cgi/session/pstore.rb 2005-09-13 21:18:21.000000000 -0600 @@ -9,7 +9,7 @@ # persistent of session data on top of the pstore library. See # cgi/session.rb for more details on session storage managers. -require 'cgi/session' +require './cgi/session' require 'pstore' class CGI @@ -62,7 +62,7 @@ path = dir+"/"+prefix+md5 path.untaint unless File::exist?(path) - unless session.new_session + unless session.new_session.nil? raise CGI::Session::NoSession, "uninitialized session" end @hash = {} now i'm noticing that the create of session is not atomic... but that's for another day. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================