Warning: session_start () [function. session-start]: Cannot send session cookie solution, sessioncookie

Source: Internet
Author: User

Warning: session_start () [function. session-start]: Cannot send session cookie solution, sessioncookie

After a session is used for many times, the following prompt is displayed,

Warning: session_start () [function. session-start]: Cannot send session cookie-headers already sent by (output started at/home/u114264/include/db_mysql tutorial. class. php Tutorial: 1) in/home/u114264/login1.php on line 3

Warning: session_start () [function. session-start]: Cannot send session cache limiter-headers already sent (output started at/home/u114264/include/db_mysql.class.php: 1) in/home/u114264/login1.php o (www.111cn.net) n line 3

The biggest possible cause of the analysis is that there is a character output including spaces before session_start (), as long as it is processed,

There is another kind of from: http://www.111cn.net/phper/31/38824.htm?directly add @ session_start () to session_start. Not recommended

Address solution.


The most common solution. Enable output_buffering = 4096; Global attribute.

 

Solution 2.


Ob_start: Open the output buffer.
Function Format: void ob_start (void)
Note: When the buffer zone is activated, all non-file header information from the PHP program is not sent, but stored in the internal buffer zone. To output the buffer content, you can use ob_end_flush () or flush () to output the buffer content.

Note:


If you use UTF-8 encoding, be sure to remove the BOM in the UTF-8, this is because the UTF-8 encoding file contains the bom, and php4, 5 are not supported bom. Remove bom and use Notepad ++ to open the conversion.


When using PHP + appserv, the following error is reported: Warning: session_start () [functionsession-start]: Cannot send?

The error is caused by an output before Session_Start () is called;
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
Remove BOM under DW
Reference: hi.baidu.com/..2.html

Warning: session_start () [functionsession-start]: Cannot send session cookie-headers already

This error is generated only when there is output before session_start ().
The file you gave is an inheritance class, which is associated with other files. At the moment, it cannot be analyzed as the file. The code is wrong!
Warning in session_start () [function. session start]: The session cookie cannot be sent-the header has been sent (output start/usr/share/PHP/header. PHP file: 1) Publish the public_html/library/joomla in/home/soft/532/session. PHP File

The problem should be in the/usr/share/php/header. php file!
Session_start () cannot be output, including spaces, html, css, and js.
 

Related Article

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.