I am aware that sessions can be lost when using a header redirect (which is what I am doing) so I am passing the session ID in the query string from my redirect page in an attempt to overcome this - Code on redirect page:
Code: Select all
$Destination = 'http://' . $Domain . $Path . '?' . 'SID=' . Session_ID();
session_write_close();
header("Location: $Destination");
exit;Code: Select all
if(isset($_GET['SID']))
{session_id(strip_tags($_GET['SID']));}
$Cookie_Domain = str_replace('www','',$_SERVER['HTTP_HOST']); //Returns .example.com to allow access on all subdomains
session_name('myname');
session_set_cookie_params(0, '/', $Cookie_Domain);
session_start();Currently I see that I am losing the session about 20% of the time. Can anyone point me in the right direction to nail down where the problem is and how to overcome it? My current best thinking is that it could be a browser specific issue (IE6 accounts for around 20% of the traffic).