Posted by Eric on 12/20/05 08:19
Rob McAninch wrote:
> 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.
>
>
Is there another way to do this with cgi?
Eric
[Back to original message]
|