Cannot send session cache limiter-headers already sent PHP error...

Source: Internet
Author: User

Cannot send session cache limiter-headers already sent error is caused by an output before session_start () is called.

For example, the following is an error:

<Br/> <? Php <br/> session_start (); // output in the first line <br/>... <br/>?>

Solution

If you do not want to see "cannot send session cache limiter-headers already...", write session_start (); as follows:

Error_reporting (e_all ^ e_warning); <br/> session_start ();

 

I declare that the above method is feasible, but not desirable! When you call:

Require ('config. inc. PHP '); </P> <p> /******************************** * *****/<br/>/* File Name: quit. PHP */<br/>/* function: the user exits the Program */<br/> /****************************** * *******/<br/> // clear the session <br/> $ _ session = array (); <br/> session_unset (); </P> <p> // clear the session <br/> session_destroy (); </P> <p> // jump page <br/> header ("Location: Index. PHP "); <br/>
To clear the session, the consequences are even more unimaginable !!!!!!!!!!!!! Therefore, the heart disease still needs to be treated with heart medicine. The final problems and solutions are as follows ::

Personal summary:

PHP code session_start () cannot be output and must be placed in the first line. Any character before the PHP code of session_start () is considered as headers.
So the solution is:
Set <? Session_start (); ......?> Put it at the beginning of the file, and <? There cannot be any character above

Self-compiled PHP program: editplus combined with DW

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.