cgi.out{
cgi.html {
cgi.body (“bgcolor” => sess[“bgcolor”]){
“The background of this page” +
“changes based on the ‘bgcolor’” +
“each user has in session.” +
“Last access time: #{lastaccess}”
}
}
}
%>
cgi.out{
cgi.html {
cgi.body (“bgcolor” => sess[“bgcolor”]){
“The background of this page” +
“changes based on the ‘bgcolor’” +
“each user has in session.” +
“Last access time: #{lastaccess}”
}
}
}
%>
No, the OP is correct. In the CGI library, cgi[‘foo’] is an array. This
is to allow for usage such as /myprogram.cgi?foo=123&foo=456
However, the next line should probably say
sess["bgcolor"] = cgi['bgcolor'][0]
or else later on,
cgi.body ("bgcolor" => sess["bgcolor"][0]){
But as to the problem with CGI::Session: I’m afraid it’s a very long
time since I bothered with rhtml or CGI, and I’m not sure that mod_ruby
has had much care and attention.
These days I think you’ll find that most people write Rack applications
(Rails and Sinatra are both layers on top of Rack), so Rack’s
session-handling is much more widely tested.
Deploying a Rails or Sinatra application under Apache is very easily
done with Phusion Passenger.
No, the OP is correct. In the CGI library, cgi[‘foo’] is an array. This
is to allow for usage such as /myprogram.cgi?foo=123&foo=456
I’m not seeing that. It’s my understanding that cgi handles multiple,
indentical names with cgi.params. For instance, given your url
cgi.params[“foo”] would return an array. However, cgi[“foo”] would
return the string “123”
However, the next line should probably say
sess["bgcolor"] = cgi['bgcolor'][0]
or else later on,
cgi.body ("bgcolor" => sess["bgcolor"][0]){
But as to the problem with CGI::Session: I’m afraid it’s a very long
time since I bothered with rhtml or CGI, and I’m not sure that mod_ruby
has had much care and attention.
I’m not even sure what this question has to do with mod_ruby.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.