summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-17 04:34:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-17 04:34:39 +0000
commitac619b9205b3a29767c5e6a602bbd123a5a269ee (patch)
tree30d9c01bc6e2a382c8bbe92ec9b78273b59f3654
parent06df6d6696fc8c315ce4341370afb2f57cc30a67 (diff)
* lib/cgi/session.rb (CGI::Session#initialize): control adding
session_id hidden fields. fixed: [ruby-talk:123850] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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 9e8d79a..efad699 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 50abf32..34549b7 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))