stefangabos / Zebra_Session

A drop-in replacement for PHP's default session handler which stores session data in a MySQL database, providing better performance, better security and protection against session fixation and session hijacking
https://stefangabos.github.io/Zebra_Session/Zebra_Session/Zebra_Session.html
Other
172 stars 85 forks source link

Question: session_id($id) does not change sid #37

Closed debgy closed 2 years ago

debgy commented 3 years ago

Hi, Thank you for providing this code.

I am using this code for Single sign on app as below. I don't need to write require because I use autoloader of framework.

class 1:
$session = new Zebra_Session($link, 'sEcUr1tY_c0dE');

session_start();
$id = session_id();

.... // I want to use this id in another timing...

class 2:
session_id($id);
$started = session_start();

I already changed session.use_strict_mode from true to false. but it still does not work. How should I change session id using session_id()? Please give me your advice if you have any ideas. Thank you!

stefangabos commented 3 years ago

There's a hardcoded

ini_set('session.use_strict_mode', 1);

in Zebra_Session.php change that value to 0 for this to work