<% class CGI_Simple < CGI attr_reader :the_cookies def initialize() super() @the_cookies = [] end def getparam(name) if has_key? name return params()[name][0] else return "" end end def getcookie(name) if cookies.has_key? name if (cookies[name].type.to_s == "CGI::Cookie") if (cookies[name].value.type.to_s == "Array") if (cookies[name].value[0].type.to_s == "String") return cookies[name].value[0] end end end end return "" end def setcookie(name, value="") cookie = CGI::Cookie.new({ 'name' => name, 'value' => value, }); @the_cookies.push( cookie ) cookies[name] = cookie end def simple_header() header('cookie' => @the_cookies) end end %>