Page 1 of 1

$_SESSION

Posted: Fri Feb 12, 2010 10:32 pm
by JackD
If I set values into $_SESSION, such as $_SESSION['EAN']='9781234', it does not get carried from one page to another. For example, if I set the value in search.php, and search.php invokes detail.php, when detail.php is invoked, $_SESSION has only the element for hreferer.

Am I doing something wrong? Is there a way to make this a global variable array from one page to another?

Re: $_SESSION

Posted: Sat Feb 13, 2010 1:08 am
by requinix
You remember to call session_start?

Post code.

Re: $_SESSION

Posted: Sat Feb 13, 2010 9:33 am
by JackD
Thanks! I did not know I had to do that.

Re: $_SESSION

Posted: Sat Feb 13, 2010 11:23 am
by JackD
Here is what I put in:

Code: Select all

 
if (!$Session_ID=session_id()) 
{ session_start(); 
  session_cache_limiter('none');  
  session_cache_expire(120); // in minutes   
  ob_start(); 
} 
 
$Session_ID was returned as "", but when the session_start() executed, I got the error:

Error: E_WARNING
session_start()[function.session-start]: Node no longer exists at detail.php line 3.

Re: $_SESSION

Posted: Sat Feb 13, 2010 12:58 pm
by requinix
Are you trying to put some SimpleXML stuff in the session? Right now you can't really do that and need to find another way of doing what you want.

Re: $_SESSION

Posted: Sat Feb 13, 2010 2:12 pm
by JackD
That could be it..... I believe I do have some of that later on in the script.

Thanks