I'm having problem with sessions & the Location command. After the header("Location: I lose all the registered Sessions. So, I tried to pass the Sessions ID with the Location. The Location statement works sometimes and not others. I'm using Zend Developer, ADODB, PHP 4.2.1, smarty on a Windows 2000 Server. If anyone has any idea would appreciate.
Here is a test program I ran to find out if it was something in my Code or a problem. It sometimes works and other times not.
include_once("defaults.inc"); /// Setup Defaults
include_once("config.inc"); /// Load Includes
$SESS_LIFE = ini_get ('session.gc_maxlifetime');
include_once("conn.inc"); /// ADODB Connection
include_once("ecom_errors.inc"); /// Error Handler
session_start();
$sess_key=session_id();
$access = 'grant';
$page_name='page1.php';
$login='shelley';
$HTTP_SESSION_VARS['saccess'] = $access;
$HTTP_SESSION_VARS['susername'] = 'FirstN LastN';
$HTTP_SESSION_VARS['suserid'] = $login;
$HTTP_SESSION_VARS['suseris'] = 'Cust';
$HTTP_SESSION_VARS['spage'] = $page_name;
header("Location: http://localhost/PHP/page2.php?K=$sess_key");
flush();