Page 1 of 1

$_SEESION works fine, and now doesn't do anything?

Posted: Sat Feb 21, 2009 1:11 am
by burnmic
Hey everyone,

I've also read that any script that needs to use register variables isn't coded well, so i'm looking into alternatives, however, this won't be for a while i'm sure. The issue that seems to have suddenly cropped up is that $_SESSION seems to have stopped working.. ?

My hosts have told me to try setting register globals to "on", this shouldn't be the case as my phpinfo file already tells me:
"register_globals local value: On master value: On"

I use a form to grab variables, and then use the following code set in a "referral-variables.php" file,

Code: Select all

<?php
session_start();
$_SESSION['partner'] = addslashes($_REQUEST['partner']);
$_SESSION['name'] = addslashes($_REQUEST['name']);"
?>
This file is then used as an include on all pages where the values are required:

Code: Select all

<?php include('../partners/referral-form/referral-variables.php');
session_start();
?>
This was working fine yesterday, but it seems to have just suddenly stopped working, but I can't seem to figure out why this may be - almost 5 hours worth of trial and error and still no joy.

Any help would be appreciated!
thanks a lot
mic

PS: i'm using lunarpages > php version 4.4.9.

Re: $_SEESION works fine, and now doesn't do anything?

Posted: Sat Feb 21, 2009 6:34 pm
by Citizen

Code: Select all

<?php
session_start();
var_dump(get_defined_vars());
$_SESSION['partner'] = addslashes($_REQUEST['partner']);
$_SESSION['name'] = addslashes($_REQUEST['name']);"
?>
Use that and tell us the output.

Re: $_SEESION works fine, and now doesn't do anything?

Posted: Sun Feb 22, 2009 3:31 am
by burnmic
I've managed to resolve this - thanks anyway :)