Posted by Rob McAninch on 12/20/05 05:04
Eric>:
> I'm playing around with cookies mostly as a learning experience.
> <body>
> <!--#exec-cgi="/cgi-bin/setcookie.cgi" -->
> </body>
>
> The cgi just writes
> "Set-Cookie: hello=its_me" to stdout
> My question is:
> is this correct?
Not as an SSI. At the point the cgi is executed the content-type
header has already been sent to the browser, too late for the
set-cookie header. You could still use JavaScript at this point
though (of course JS is now required to be enabled on the client
browser).
If you're entire page is created in CGI then just send out the
cookie header before the content-type.
--
Rob McAninch
http://rock13.com
[Back to original message]
|