Home  >  Article  >  Backend Development  >  PHP error: Cannot send session cookie – headers already sent by solution

PHP error: Cannot send session cookie – headers already sent by solution

WBOY
WBOYOriginal
2016-07-25 09:04:301302browse
  1. UTF-8 EF BB BF
  2. UTF-16 Big Endian FE FF
  3. UTF-16 Little Endian FF FE
  4. UTF-32 Big Endian 00 00 FE FF
  5. UTF-32 Little Endian FF FE 00 00
Copy the code

Solution: When performing PHP session operations, if: Warning: Cannot send session cookie – headers already sent…” or “Cannot add header information – headers already sent…” appears

Just set the Output_buffering in php.ini, the default value is no, change it to 1.



Statement:
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