printing HTTP header for webserver scripts and cookie setting
[1/4] from: sags::apollo::lv at: 23-Apr-2006 21:04
I am using first print in MS IIS f.ex. print "Content-type: text/html^/" and it works. Or if I does not print it the script does not work. But it works differently on other servers (f.ex. KFWS and Abyss) - there I do not need print "Content-type: text/html^/" to get script working. So I can not send header like just first script output lines. So the question is how to manage setting of cookie values in such cases? Janeks On 26 Apr 2005 at 16:24, Eric Haddix wrote:
[2/4] from: SunandaDH:aol at: 23-Apr-2006 18:18
> So the question is how to manage setting of cookie > values in such cases?
What should happen is that you print all headers *before* the first blank line -- ie the ^/ So you can set a cookie like this: print "Content-type: text/html" print "Set-Cookie: name=xxxxxxx" print "" ;; end of headers print ;; start of content Sunanda.
[3/4] from: sags:apollo:lv at: 24-Apr-2006 7:33
It looks like in cases of KFWS and Abyss, the web server already sent this blank line. :( Janeks On 23 Apr 2006 at 18:18, SunandaDH-aol.com wrote:
[4/4] from: Izkata::Comcast::net at: 23-Apr-2006 23:39
You're using this, right? print "Content-type: text/html^/" 'print adds it's own newline after printing the string. So all you (should) need to do is either remove the "^/", or use 'prin.