[phplib] Passing session variables From: A.C.N.S. Information and News (infomail <email protected>)
Date: 01/23/01

OK, here's the problem. I can't seem to get the session variables to pass right. I'm losing scope after I include a file. I setup the session so:

page_open(array("sess"=>"cart_sess"));
if (!isset($SESSION)){$SESSION = array();};

$sess->register("SESSION");

// I then assign some values to the array so:

$SESSION["brand_used"] = 1;
$SESSION["iva_used"] = 0;
$SESSION["iva_value"] = 0;

$SESSION["price_must_be_integer"] = 0; (etc.....)

// Then comes the include:

$CFG->global = $CFG->localedir.$SESSION["lang"]."/global.inc.php3";

However, inside the include I don't have access to the session variables. My understanding was that any variables initialized in the upper file would have a global scope for the entire session. If it were initialized in a class, function or included file it would be local to that area and not global.

Example from global.inc.php3:

$username_too_short = "Username too much short: ".$SESSION["username_length_min"]." characters min";

Also, When I hit the page I can see the session ID in the URL but it is not being logged to the DB.

Sorry to be asking soooooo many questions but the documentation is just a tad cryptic. Any help would be greatly appreciated. Thanks

Chuck