Forum: Ruby Help with print cgi.header(

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Dc38ff4f679fe0651d9e86f36c9a7885?d=identicon&s=25 Ernest Ellingson (Guest)
on 2006-02-04 23:29
(Received via mailing list)
I'm trying to set a cookie using Apache on RHFedora core3 and Ruby CGI
I'm sending a pdf file.

The mail format looks as if there are two lines for the cookie header,
but in reality there is only one.

Here are the headers I'm printing

cookexpires=( + (60 * 24 * 3600)).strftime("%a, %d-%m-%Y%H:%M:%S
print cgi.header("Content-Type" => mimeTypes[mimer])
print cgi.header("Content-Dispostion" => filename)
print cgi.header("Content-length" => s.length.to_s)
print cgi.header("Set-Cookie" => "#{CGI.escape("sample_issue=yes;")};
expires=#{cookexpires}; domain=ftienergybusinesswatch")
print "\r\n"
print "\r\n"

The pdf file gets sent OK in Firefox.  The pdf file opens correctly but
no cookie shows up.

In IE I have to do it this way for the file to appear correctly and the
cookie does show up in IE."sample_issue", "yes") + (60 *24*3600) # 60 days
This topic is locked and can not be replied to.