Why is my SESSION array OK on one page but empty on another?

Moonclan

New Member
I have a class that sets various session variables. After I set the session variable I do a var dump of SESSION and get an output of them all. all good so far. Then I navigate to another page. \[code\]session_start(); // i call this right after opening the php tagvar_dump($_SESSION); // i call this after setting the variables\[/code\]and it's empty this time?Setting my sessions\[code\]while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)) { $_SESSION['atid'] = $row['autotaskid']; $_SESSION['bmsid'] = $row['bmsid']; $_SESSION['shavlikid'] = $row['shavlikid']; $_SESSION['cpid'] = $row['cpid']; }\[/code\]Trying to use the variables on another page\[code\]$autotaskid = $_SESSION['atid']; $tsql = "SELECT COUNT(tblBackupArchive.StatusID) AS total, tblBackupArchive.StatusID ". "FROM tblBackupArchive INNER JOIN ". "tblBackup ON tblBackupArchive.BackupID = tblBackup.BackupID ". "GROUP BY tblBackupArchive.StatusID, tblBackup.ClientID ". "HAVING (tblBackup.ClientID = " . $autotaskid . ")"; \[/code\]Results in\[code\]Undefined index: atid in C:\Program File...\[/code\]I've made sure I'm issuing the start_session(); function before any other code is run on every page that uses them.Another important point: the php page that calls the method setting the variables within an iframe. when i open the page in a new tab/window it sets the sessions correctly. It's almost like the main window has session variables and then each iframe keeps it own seperate.Any ideas?Billy
 
Back
Top