diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/cgi/session.rb | 8 |
2 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Fri May 2 17:37:01 2003 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/cgi/session.rb (CGI::Session::initialize): updated to + support 2003-04-23 change in cgi.rb [ruby-core:1002] + Fri May 2 17:21:02 2003 Yukihiro Matsumoto <matz@ruby-lang.org> * class.c (method_list): classify methods based on nearest diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb index 79ee0e3fef..9306508239 100644 --- a/lib/cgi/session.rb +++ b/lib/cgi/session.rb @@ -27,15 +27,17 @@ class CGI def initialize(request, option={}) session_key = option['session_key'] || '_session_id' - id, = option['session_id'] + id = option['session_id'] unless id if option['new_session'] id = Session::create_new_id end end unless id - id, = request[session_key] - id = id.read if id.respond_to?(:read) + if request.key?(session_key) + id = request[session_key] + id = id.read if id.respond_to?(:read) + end unless id id, = request.cookies[session_key] end |