summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--lib/cgi/session.rb11
2 files changed, 12 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 9e8d79ad0f..efad69959b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,14 @@
+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]
+
Thu Dec 16 23:25:25 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.rb, lib/drb/ssl.rb: backported from CVS HEAD.
[druby-ja:101]
- * test/drb/test_drb.rb: adjust and reduce sleep (backported from
+ * test/drb/test_drb.rb: adjust and reduce sleep (backported from
CVS HEAD.)
Thu Dec 16 18:44:58 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
@@ -141,7 +146,7 @@ Sun Dec 12 10:14:03 2004 Dave Thomas <dave@pragprog.com>
Sat Dec 11 20:12:21 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * lib/drb/drb.rb: add DRbRemoteError. [ruby-list:40348],
+ * lib/drb/drb.rb: add DRbRemoteError. [ruby-list:40348],
[ruby-list:40390]
* test/drb/drbtest.rb: ditto.
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index 50abf32136..34549b7753 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -253,15 +253,14 @@ class CGI
end
end
unless session_id
- if request.key?(session_key)
- session_id = request[session_key]
+ if session_id = request[session_key]
session_id = session_id.read if session_id.respond_to?(:read)
end
unless session_id
session_id, = request.cookies[session_key]
end
unless session_id
- if option.key?('new_session') and not option['new_session']
+ unless option.fetch('new_session', true)
raise ArgumentError, "session_key `%s' should be supplied"%session_key
end
session_id = create_new_id
@@ -272,14 +271,14 @@ class CGI
begin
@dbman = dbman::new(self, option)
rescue NoSession
- if option.key?('new_session') and not option['new_session']
+ unless option.fetch('new_session', true)
raise ArgumentError, "invalid session_id `%s'"%session_id
end
session_id = @session_id = create_new_id
retry
end
request.instance_eval do
- @output_hidden = {session_key => session_id}
+ @output_hidden = {session_key => session_id} unless option['no_hidden']
@output_cookies = [
Cookie::new("name" => session_key,
"value" => session_id,
@@ -293,7 +292,7 @@ class CGI
else
""
end)
- ]
+ ] unless option['no_cookies']
end
@dbprot = [@dbman]
ObjectSpace::define_finalizer(self, Session::callback(@dbprot))