Hello fellows.
10,000$ question here.
Im currently working on a collection of scripts that will work in command line only. Im using the latest version of PHP.
Ive got problems figuring out how to start a session with a specific session_id. Maybe im doing something wrong here, but ive got no idea what.
It seams that if I call session_start($id), where $id is a sessionid that i know for sure was already registered earlier, that specific session does not get initialized.
See this simple test script
#!/usr/bin/php -q
<?
$sessid = $argv['1'];
print "Starting session: $sessid\n";
session_start($sessid);
if (session_id() != $sessid) {
print "Requested session to initialize: $sessid\n";
print "Initialized session ID: " . session_id() . "\n";
print "Session ID differs ?? \n";
}
if (empty($_SESSION)) {
print "SESSION empty ??\n";
}
?>
And its output :
./session-get.php 3112a7c05161cc77e9fe1a1fe9e6348c
Starting session: 3112a7c05161cc77e9fe1a1fe9e6348c
Requested session to initialize: 3112a7c05161cc77e9fe1a1fe9e6348c
Initialized session ID: 5f4ba9af84ef44270bcb0ea7eda38aa3
Session ID differs ??
SESSION empty ??
Please gimme some pointers here 😉