summaryrefslogtreecommitdiff
path: root/lib/cgi/session.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cgi/session.rb')
-rw-r--r--lib/cgi/session.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index 967603f59cc..6940546ab21 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -51,7 +51,14 @@ class CGI
@dbman = dbman::new(self, option)
request.instance_eval do
@output_hidden = {session_key => id}
- @output_cookies = [Cookie::new(session_key,id)]
+ @output_cookies = [
+ Cookie::new(session_key => id,
+ "path" => if ENV["SCRIPT_NAME"] then
+ File::dirname(ENV["SCRIPT_NAME"])
+ else
+ ""
+ end)
+ ]
end
ObjectSpace::define_finalizer(self, Session::callback(@dbman))
end