Reply to Re: Session_Start() Hangs after setting Session_Id

Your name:

Reply:


Posted by Tony Marston on 06/30/06 08:30

"Syl" <david.hunter@gmail.com> wrote in message
news:1151631588.219436.322850@d56g2000cwd.googlegroups.com...
>
> CjB wrote:
>> Hello, I am trying to do the following in one of my pages.
>> session_id($_GET['SESSIONID']);
>> session_start();
>>
>> I am running php5, however as soon as I call session_start the script
>> hangs and nothing happens. Is anyone else experiencing this problem, or
>> am I doing something incorrectly?
>>
>> Thanks!
>
> session_start(); must always be listed at the top of every page.
> like this :
>
> <?php
> session_start();
>

That is not necessarily true. It does NOT have to be the very first
statement in the script, but BEFORE you want to start using the $_SESSION
array.

You need to check that you have a value in $_GET['SESSIONID'] before you use
it. Try this:

if (isset($_GET['SESSIONID'])) {
session_id($_GET['SESSIONID']);
} // if
session_start();

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

[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

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