|
Posted by Mara Guida on 12/11/05 02:59
Arnold Shore wrote:
> With 'session_start()', how do I avoid the complaint "PHP Notice: A session
> had already been started" ?
> Without 'session_start()', I get the "Undefined variable: _SESSION "
> complaint.
<snip>
Maybe you're trying to do session_start() more than once.
Try this:
<?php
echo 'ini_get('session.auto_start') is ',
ini_get('session.auto_start'), "<br>\n";
echo 'before session_start() session_id() returns ', session_id(),
"<br>\n";
// You may want to replace your session_start()s with this too
if (!session_id()) session_start();
echo 'after session_start() session_id() returns ', session_id(),
"<br>\n";
?>
[Back to original message]
|