From: 7stud -- Date: 2009-08-15T22:20:49+09:00 Subject: Re: CGI::Session weird behavior pharrington wrote: > On Aug 14, 9:55�am, Bruno Sousa wrote: >> � 3 require 'cgi/session' >> �12 sess["lastaccess"] = Time.now >> �23 } >> �24 =end >> �25 >> �26 sess.close >> �27 >> �28 %> >> -- >> Posted viahttp://www.ruby-forum.com/. > > If don't want to use cgi.out, you'd need to at least send back some > http headers (at least Content-type) for anything to reach the user. > (also, I don't know why you're using cgi = CGI.new("html4") if you > don't want the html helpers, but :\ ) The first thing you should output is: 1) print "Content-type: text/html\r\n\r\n" or equivalently: 2) puts cgi.header 3) Or you can also use cgi.out, which will automatically take care of the header information, like this: require 'cgi' cgi = CGI.new html =< Test

hello world

ENDOFHTML cgi.out do html end -- Posted via http://www.ruby-forum.com/.