Currently I build single sign on of many website in my office, some of them are written with native PHP, I set global session with codeigniter, It's work properly between codeigniter app, but I try to read the session value in native PHP. Below is my code in Native PHP
ini_set('session.gc_maxlifetime', 7200);
ini_set('session.name', 'sso_session');
// this line caused login session destroyed (trying to set domain path)
session_set_cookie_params(
7200,
'/',
'.myapp.local',
FALSE,
TRUE
);
ini_set('session.use_trans_sid', 0);
ini_set('session.use_strict_mode', 1);
ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1);
ini_set('session.sid_length', 32);
session_start();
print_r($_SESSION); // return empty array
I try to use Codeigniter session driver but I look inside the code, seem it's need dependencies of many codeigniter classes, too many changes that I need to modify the code.