summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi/session.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index a6e999bc34..2dea08cf75 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -188,7 +188,6 @@ class CGI
md5.update('foobar')
session_id = md5.hexdigest
end
- @new_session = true
session_id
end
private :create_new_id
@@ -256,6 +255,7 @@ class CGI
unless session_id
if option['new_session']
session_id = create_new_id
+ @new_session = true
end
end
unless session_id
@@ -271,6 +271,7 @@ class CGI
raise ArgumentError, "session_key `%s' should be supplied"%session_key
end
session_id = create_new_id
+ @new_session = true
end
end
@session_id = session_id
@@ -281,7 +282,8 @@ class CGI
unless option.fetch('new_session', true)
raise ArgumentError, "invalid session_id `%s'"%session_id
end
- session_id = @session_id = create_new_id
+ session_id = @session_id = create_new_id unless session_id
+ @new_session = true
retry
end
request.instance_eval do