Pedro Graca wrote:
<?php
require_once 'foo.class.php';
session_start();
$w = $_SESSION['foo'];
$w->bar();
?>
I'm having the same trouble. When I try that, I get the following:
Warning: session_start() [function.session-start]: Cannot send session cache
limiter - headers already sent (output started
at /srv/www/htdocs/.../test_class.inc:16) in /srv/www/htdocs/.../test2.php
on line 4
Where test_class.inc has a simple class definition.
test1.php creates an instance of the class and stores it as
$_SESSION['junk'].
And test2.php looks like:
<?php
require_once ('test_class.inc');
session_start();
$_SESSION['junk']->display();
?>
It seems to process everything well enough, but the warning is annoying. Is
this a problem? I'm sure it's just a matter of turning an option off
somewhere to get rid of the warning, but should it not work without getting
it in the first place?
php 4.3.1
apache 1.3.27
linux kernel 2.4.20
John