Cannot send session cache limiter

Posts: 31

Cannot send session cache limiter

I have a php page where i work with session..

Code: Select all

if (isset($_SESSION['username'])) {
   } else {
    echo "<script type='text/javascript'>  window.location='index.php'; </script>";

// etc. php code

but i get this error:

Code: Select all

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/mluci/public_html/d/message.php:1) in /home/mluci/public_html/d/message.php on line 1

That error appears because there is something sent to browser before session_start();, like an "echo", or a space or other character before the starting "<?php".
Make sure you put session_start(); before you output any character to browser, not even a space before "<?php".
Also, use a text editor with "Encoding UTF-8 without BOM" (for example Notepad++).

- The same goes for header() and cache() functions.

Adv. Posts: 01

Similar Topics