Re: Session_Start() Hangs after setting Session_Id




Tony Marston wrote:
"Syl" <david.hunter@xxxxxxxxx> wrote in message
news:1151631588.219436.322850@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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


Of course - you are absolutely correct Tony.

Thanks for clarifying my post.

.



Relevant Pages

  • Re: [PHP] How to launch a background task from a web page
    ... On Thu, Oct 30, 2008 at 11:38 AM, Tony Marston ... exec() operators seems to imply that the PHP function will be suspended ... until the script finishes, which is not what I want. ...
    (php.general)
  • Re: PHP more development time?
    ... Tony Marston ... For my case I don't want to wait until you run the script. ... I want to fix my syntax error as i create a class or bean. ... use a proper IDE, such as Zend Studio, it can give you hints that your ...
    (comp.lang.php)
  • Re: Getting rid of imported variables
    ... Is there a way to unset all the imported get/post etc. variables at ... > the beginning of my script? ... Tony Marston ...
    (comp.lang.php)
  • Re: Session_Start() Hangs after setting Session_Id
    ... I am running php5, however as soon as I call session_start the script ... hangs and nothing happens. ... Is anyone else experiencing this problem, ...
    (comp.lang.php)
  • Re: Session_Start() Hangs after setting Session_Id
    ... I am running php5, however as soon as I call session_start the script ... hangs and nothing happens. ... Is anyone else experiencing this problem, ...
    (comp.lang.php)