Reputation: 34533
Would like to set cookies from the server (CGI - C)
Can it be set after the header has been printed?
Thanks.
Upvotes: 1
Views: 328
Reputation: 70158
Not directly, cookies that come directly from the server must be explicitly set in the response header using Set-Cookie
. See here for a thorough explanation.
Upvotes: 4
Reputation: 943569
You can set cookies using JavaScript embedded in an HTML document, or via a few other mechanisms, such as Flash.
Other than that though, the header is the only place in HTTP you can set them.
Upvotes: 2