Hello Php Champs,

I am new in php , I am getting this problem
Warning: session_start() [function.session-start]:
Cannot send session cache limiter - headers already sent

I have written the following code at the top of header.php

<?php ob_start(); 
session_start(); ?>

I am new, failed to understand what could be the reason ..

Thanks a ton

Edited by peter_budo: Please do not use Code Snipets for asking questions. Use Forum Thread option.

8 Years
Discussion Span
Last Post by cwarn23

You're sure you have placed it at the very top of the page before any type of html output? If not, they should be the very first 3 lines of the page before anything gets sent to the browser, including whitespace.

Edited by CFROG: n/a



Yes i have placed the code on top of the page, there is no space before taht

<?php ob_start(); session_name(); session_start(); ?>

What could be the other possibilities ?



Another tutorial to write about. This problem can be caused by using a text editor that adds invisible junk code at the beginning of the text file. First replace your code with the following:

<?php session_start();
ob_start(); ?>

Then save it and reopen in windows notepad. Yer that old fashion program. After that click just before the first p on line 1 and press backspace 10 times. Then type back in the <? symbols and click save. After that upload to your server and see if it works.

Btw, could you tell me what text editor your using so I can download a copy to replicate the problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.