Raising the Bar: An Internet Marketing Blog for Lawyers.

Blogging on Law Firm, Professionals and Business Web Design

Peter Boyd

How to Fix: Warning: session_start() [function.session-start]: Cannot send session cache limiter

We recently came across this pesky problem and found these two articles very helpful.

Don’t save your UTF-8 files with BOM as it creates issues.

=================

http://juicystudio.com/article/utf-byte-order-mark.php

“Headers must be written before any data is sent to the client. Unicode files may include a Byte-Order Mark (BOM) to help distinguish the big endian and little endian byte order. Unfortunately, the BOM isn’t understood by PHP. Upon encountering the BOM, PHP assumes that it is dealing with data, by which time it’s too late to modify headers. Solution? Save the file in UTF-8 encoding without a BOM.”

and

http://69.147.83.196/bug.php?id=44563&edit=2

“If file A or file B has UTF-8 encoding then you will get the error:

Warning: session_start() [function.session-start]: Cannot send session
cache limiter – headers already sent (output started at index.php:1) in
session.php on line 3

Using UTF-8 encoding WITHOUT BOM (Byte Order Mark) seems to fix the
problem.”

=================

If file A or file B has UTF-8 encoding then you will get the error:

Warning: session_start() [function.session-start]: Cannot send session
cache limiter - headers already sent (output started at index.php:1) in
session.php on line 3

Using UTF-8 encoding WITHOUT BOM (Byte Order Mark) seems to fix the
problem.
  • viderbit

    Omg thanks bro, i can’t believe that BOM can make browser to thing that receive header information instead BOM signature…

    • David@iconera

      my site hosted live and i used the editor in cpanel to make one small change. nexst thing the error came up. thankfully we have google and people who post solutions. TIP: if you use the cpanel editor, use the code editor it works for php.
      Regard

      David
      Icon Era

  • http://were.com Tinu

    please ensure that these is nothing before session_start() command. Even a white space before the session_start() command will generate this warning message

    Wrog:

    Correct:

    • Alok

      Dear, u r right a white space created problem in my code and i rectified it, thank you very much.

  • Bojan

    Than you very much =) I almost give up on fixing this error, but thanks to you the error is now gone :)

  • Terminal

    Thanks bro. It was too painfully for me. But now it works fine just after eliminating the white space before php tag.

    Many many thanks

  • Golyoka

    Many many thanks, i s*ck with these error about 2 hours.

  • Canguingo

    peteboyd i love you so much!!! problem solved, not only the file cousing the warning but all files should not be saved in UTF-8… ;)

    many many thanx!

  • emilakia

    thanks a lot!!!!!!!:):)

  • Zobi_89

    can anybody fix it plz..i m fucked up but can fixed it ..get same erroe of session cant start..

    login_check

    0) {
    $errorMessage= “logged on “;
    }
    else {
    $errorMessage= “Invalid Logon”;
    }
    if (rows > 0) {
    session_start();
    $_SESSION['login'] = “1″;
    header (“Location: verify.php”);
    }
    else {
    session_start();
    $_SESSION['login'] = ”;
    }
    ?>

  • liladhar

    Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at D:Sitessingle57liladharmangewebrootsbseditprofile.php:1) in D:Sitessingle57liladharmangewebrootsbseditprofile.php on line 2
    kindly help in above




Categories:

About Us

PaperStreet creates new web sites and revitalizes aging ones. In addition to creating web sites that are engaging, we also have a knack for getting results.

Read More »



Featured Portfolio:

View All
Contact Us