Connecting Tech Pros Worldwide Help | Site Map

Session_Start() Hangs after setting Session_Id

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 30th, 2006, 12:05 AM
CjB
Guest
 
Posts: n/a
Default Session_Start() Hangs after setting Session_Id

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!


  #2  
Old June 30th, 2006, 01:35 AM
Syl
Guest
 
Posts: n/a
Default Re: Session_Start() Hangs after setting Session_Id


CjB wrote:[color=blue]
> 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![/color]

session_start(); must always be listed at the top of every page.
like this :

<?php
session_start();

  #3  
Old June 30th, 2006, 08:25 AM
Tony Marston
Guest
 
Posts: n/a
Default Re: Session_Start() Hangs after setting Session_Id


"Syl" <david.hunter@gmail.com> wrote in message
news:1151631588.219436.322850@d56g2000cwd.googlegr oups.com...[color=blue]
>
> CjB wrote:[color=green]
>> 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![/color]
>
> session_start(); must always be listed at the top of every page.
> like this :
>
> <?php
> session_start();
>[/color]

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


  #4  
Old June 30th, 2006, 02:25 PM
Syl
Guest
 
Posts: n/a
Default Re: Session_Start() Hangs after setting Session_Id


Tony Marston wrote:[color=blue]
> "Syl" <david.hunter@gmail.com> wrote in message
> news:1151631588.219436.322850@d56g2000cwd.googlegr oups.com...[color=green]
> >
> > CjB wrote:[color=darkred]
> >> 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![/color]
> >
> > session_start(); must always be listed at the top of every page.
> > like this :
> >
> > <?php
> > session_start();
> >[/color]
>
> 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[/color]


Of course - you are absolutely correct Tony.

Thanks for clarifying my post.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.