Troubleshooting “Warning: session_start(): Cannot send session cache limiter - headers already sent”

后端 未结 15 1780
醉酒成梦
醉酒成梦 2020-11-28 14:34

i am getting Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at error

<
15条回答
  •  孤街浪徒
    2020-11-28 15:00

    I had a website transferring from one host to another, it seemed to work fine on the old host but a few pages on the new host threw the error

    Warning: session_start(): Cannot send session cache limiter - headers already sent
    while I always kept the

     <?php
    session_start(); 

    at the top of the page no spaces and nothing inserted before

    it really bugged me that I stared every page with the session opening, and it worked on some pages and run through a bug on others I picked the pages that had the problems, backed them up, created new blank pages and simply copied and pasted the code as is, saved and uploaded and boom, problem gone!

    this is something you guys may need to consider, it may have been the encoding of the page, or something, not sure the exact source of the problem, but here is a fix to look at in case you guys run into a similar problem

    cheers!

提交回复
热议问题