Dunno if this will help, but some kind folks helped me out when I was going nuts over 'sessions':
$_SESSION['myvar'] = $_POST['myvar'];
$url = "$nextpage.php" . "?" . session_name() . "=$sessid";
header("Location: $url");
Sure hope this helps!!!
BTW, I put this at the top of EACH page:
ob_start();
session_start();
$sessid = session_id();
And this at the bottom of EACH page:
ob_end_flush();
I dunno the difference from what you are doing, all I know is it WORKS!!! (After many, many frustrating hours to get there).
Good Luck!!!
(EDIT🙂 Ohhhh...
One thing which caused me over 20 hours of frustrating, wasted time was this (check your phpinfo file):
session.use_trans_sid
This MUST be set to either "1" or "On" for it all to work.