Reply to Re: Sessions Again

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация