Index: lib/cgi.rb =================================================================== --- lib/cgi.rb (Revision 17920) +++ lib/cgi.rb (Arbeitskopie) @@ -822,8 +822,8 @@ super(@value) end - attr_accessor("name", "value", "path", "domain", "expires") - attr_reader("secure") + attr_accessor("name", "path", "domain", "expires") + attr_reader("secure", "value") # Set whether the Cookie is a secure cookie or not. # @@ -832,17 +832,17 @@ @secure = val if val == true or val == false @secure end + + def value=(val) + @value.replace(Array(val)) + end # Convert the Cookie to its string representation. def to_s buf = "" buf += @name + '=' - if @value.kind_of?(String) - buf += CGI::escape(@value) - else - buf += @value.collect{|v| CGI::escape(v) }.join("&") - end + buf += @value.map { |v| CGI::escape(v) }.join("&") if @domain buf += '; domain=' + @domain