From: s@... (Stefan Schmiedl) Date: 2002-02-22T07:59:09+09:00 Subject: Re: dang it, CGI::Session is broken again On Thu, 21 Feb 2002 16:37:33 GMT, Alan Chen wrote: > I retested that script on my side, when I entered a session_id, the id didn't have > an underscore in it. When I remove the underscore, it works on my system. With the > underscore, I get an internal server error, hmmm.. > > > On Thu, Feb 21, 2002 at 10:58:49PM +0900, Dan McNulty wrote: >> [cgiuser@0FEC2CAF cgi]$ ./test.rbx >> (offline mode: enter name=value pairs on standard input) >> junk=test >> /usr/lib/ruby/1.6/cgi/session.rb:108:in `initialize': session_id >> `a_test' is invalid (ArgumentError) >> from /usr/lib/ruby/1.6/cgi/session.rb:51:in `new' >> from /usr/lib/ruby/1.6/cgi/session.rb:51:in `initialize' >> from ./test.rbx:8:in `new' >> from ./test.rbx:8 >> >> Quoting from cgi/session.rb class FileStore def check_id(id) /[^0-9a-zA-Z]/ =~ id.to_s ? false : true end So the underscore is invalid for session ids which denote a file name. I ran against the same wall when I wanted to create an id "K�che" ... Seems a little bit too rigid, but you can always override it, if you know which platform you are on. s.