Selom
Selom

Reputation: 735

Cannot send session cache limiter, what am i missing?

can someone please tell me what Im missing? this simple script

<?
session_start();
?>

displays the following error message:

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

thanks.

Upvotes: 0

Views: 1079

Answers (3)

Sampson
Sampson

Reputation: 268414

session_start(); should be the first thing on your page. Before any text, or spaces. Nothing should precede it in your page.

<?php

  session_start();

  /* code here */

?>

Upvotes: 1

a.yastreb
a.yastreb

Reputation: 1493

Check if there are any whitespaces before <? If there is any output before session_start() - it will not work

Upvotes: 2

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799082

It may be a Byte Order Mark generated by your text editor.

Upvotes: 2

Related Questions