"No Spam" <ns.DeleteThis@spamfree.net> schreef in bericht
news:wW8Ac.416$Ny6.1136@mencken.net.nih.gov...
> in perl, one can use:
> use CGI qw/:standard/;
> use CGI::Carp 'fatalsToBrowser';
> use strict;
> print "Set-Cookie: user=john;password=secret;path=/;
> However, in C if you just use
> printf("Content-type: text/html\n\n");
> printf("Set-Cookie: user=john;password=secret;path=/;");
> You get that printed in the screen.
In fact you are writing an HTTPheader directly -no need for CGI for that-
A header of that kind ends with a blanc line...
.... the _ second_ \n in the first printf() is such a line.
All data following that blanc line is considered data and so your browser is
displaying it.
HansH<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: How to set-cookie in CGI with C?