Why can PHP output but the cookie can still be set successfully?

WBOY
Release: 2016-10-10 11:56:09
Original
972 people have browsed it

Copy after login
Copy after login

Reply content:

Copy after login
Copy after login

It’s mentioned in the manual

Cookies are part of the HTTP headers, so the setcookie() function must be called before other information is output to the browser.

But PHP will enable output_buffering by default

Why can PHP output but the cookie can still be set successfully?

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!