summaryrefslogtreecommitdiff
path: root/lib/cgi
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-16 04:55:14 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-16 04:55:14 +0000
commitb93479b8d9b8f0f95844d8e53ad954445177af00 (patch)
tree2ab3eafa7c7820209707824cabea6de573c1244e /lib/cgi
parentc2b7884076865795a309a93eda6589a66150e968 (diff)
* string.c (str_mod_check): frozen check should be separated.
[ruby-core:3742] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi')
-rw-r--r--lib/cgi/session.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index 6ca85e1806..401ce089c0 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -159,7 +159,7 @@ class CGI
attr_reader :session_id
def Session::callback(dbman) #:nodoc:
- lambda{
+ Proc.new{
dbman[0].close unless dbman.empty?
}
end
@@ -351,17 +351,21 @@ class CGI
# on Unix systems).
# prefix:: the prefix to add to the session id when generating
# the filename for this session's FileStore file.
+ # Defaults to "cgi_sid_".
+ # suffix:: the prefix to add to the session id when generating
+ # the filename for this session's FileStore file.
# Defaults to the empty string.
#
# This session's FileStore file will be created if it does
# not exist, or opened if it does.
def initialize(session, option={})
dir = option['tmpdir'] || Dir::tmpdir
- prefix = option['prefix'] || ''
+ prefix = option['prefix'] || 'cgi_sid_'
+ suffix = option['suffix'] || ''
id = session.session_id
require 'digest/md5'
md5 = Digest::MD5.hexdigest(id)[0,16]
- @path = dir+"/"+prefix+md5
+ @path = dir+"/"+prefix+md5+suffix
unless File::exist? @path
@hash = {}
end