I have a problem with passing session variables with cookies disabled.
Script 1:
session_start();
$_SESSION['x'] =55;
then I pass the session ID via URL (I tried it both via chancing the php init settings and also explictely appending it to URL) for example:
<a href="abc.php?<?php echo SID; ?>">abc to</a>
Script 2 abc.php:
session_start();
session_id($_GET['PHPSESSID']);
echo session_id();
I check the ID in second script, its exactly the same. But when I try to use the:
$_SESSION['x'] variable or to print_r on $_SESSION it shows it is not set.
Unbelievable. After hours of searching I finally found a solution only minutes within posting this question here.
The order should be:
So the first the ID has to be set and then the session started. Or at least it seems so.