atom feed2 messages in com.googlegroups.professional-phpRe: Problem with $_SESSIONS ...
FromSent OnAttachments
dbeeJan 10, 2008 10:06 am 
dbeeJan 10, 2008 10:22 am 
Subject:Re: Problem with $_SESSIONS ...
From:dbee (
Date:Jan 10, 2008 10:22:20 am

Hi Gary,


I do have ...


in at the top of the page, so it's not that unfortunately...



On Jan 10, 6:08 pm, "Gary Every" <> wrote:

do you have session_start() in upload?

On Jan 10, 2008 11:06 AM, dbee <> wrote:


I'm creating some on-the-fly sessions code and I'm having a problem getting my session variables to propagate


$session_code = md5($albumname . 'randomtext');

// Log them in for this album $_SESSION["session_name"] = $session_code;

// Reroute to the upload page ... header("Location:$session_name");


$session_name = $_GET['session_name'];

// Check whether they are authenticated for this album if ($_SESSION['session_name'] == md5($session_name . 'randomtext') ) {


I can set the session variable on login.php no problem. But when I redirect to upload.php the $_SESSION array is empty.

Also, can anyone see a major flaw in using sessions in this manner ? The obvious one is that the actual session code will remain persistent. But since the timeout is only one hour it's not too much of an issue. The code is closed source of course so predicting the randomtext wouldn't be easy. I don't have time to go on and flesh out a proper sessions class ..

Anyway thanks,