You are here: Re: Session_start() « PHP Programming Language « IT news, forums, messages
Re: Session_start()

Posted by Tim Van Wassenhove on 09/26/07 11:37

On 2006-01-17, Steve <ThisOne@Aint.Valid> wrote:
> On Tue, 17 Jan 2006 00:17:03 +0000, Pedro Graca wrote:
>
>> camou wrote:
>>> I get this error message: A session had already been started - ignoring
>>> session_start().
>>>
>>> How can I check to see if a session was started already?
>>
>>
>> if (!session_id()) {
>> /* session not started */
>> }
> I thought it was
>
> if (session_id() == "")
> {
> /* session not started */
> }

There are some usercomments about that in the manual on
http://www.php.net/session_id

I prefer to do it as following:

if (!isset($_SESSION)) {
// session is not started.
}

As documented on http://www.php.net/session the global $_SESSION only becomes
available after the use of session_start();

--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>

 

Navigation:

[Reply to this 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

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