开发者

Does a cookie have to be set in the http header?

开发者 https://www.devze.com 2022-12-20 01:07 出处:网络
Would开发者_运维知识库 like to set cookies from the server (CGI - C) Can it be set after the header has been printed?

Would开发者_运维知识库 like to set cookies from the server (CGI - C)

Can it be set after the header has been printed?

Thanks.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消