The recent change to the CGI::Session
Fri Dec 17 13:33:58 2004 Nobuyoshi Nakada <nobu / ruby-lang.org>
* lib/cgi/session.rb (CGI::Session#initialize): control adding
session_id hidden fields. fixed: [ruby-talk:123850]
introduced a new problem. It didn't take into account that CGI#[](key)
method returns an empty string for the nonexistent key. Please apply
the following patch to HEAD and ruby_1_8 branch.
Index: lib/cgi/session.rb
===================================================================
RCS file: /src/ruby/lib/cgi/session.rb,v
retrieving revision 1.23.2.12
diff -u -r1.23.2.12 session.rb
--- lib/cgi/session.rb 17 Dec 2004 04:34:39 -0000 1.23.2.12
+++ lib/cgi/session.rb 19 Dec 2004 08:19:06 -0000
@@ -253,7 +253,8 @@
end
end
unless session_id
- if session_id = request[session_key]
+ if request.key?(session_key)
+ session_id = request[session_key]
session_id = session_id.read if session_id.respond_to?(:read)
end
unless session_id
Cheers,
Kent.