I want to destroy restore the session id and then start the session, which is done in standard PHP like following. How can I do this in CodeIgniter?
session_destroy();
session_id($old_session_id);
session_start();
I think session is started automatically by autoloading the library:
$autoload['libraries'] = array('session');
Is it so? How can I use the session_id($old_session_id); in CodeIgniter?
I’m trying with $this->session->set_userdata('session_id', $old_session_id);
But it seems that something is not working fine, as i can not get the session data. Any idea if anything is wrong with the above lines or something else?
Thanks.
Some things to check for:
Check to ensure sessions are working in PHP without CodeIgniter. If sessions do not work then your server is not saving session info correctly
Check if you are saving session information to the database or not (In application/config/config.php does $config[‘sess_use_database’] equal FALSE? If TRUE, then make sure to have this code imported into your DB
If something is not correct here then CI is not saving session info.
Check your error logs to see if CI is loading the session library module and no errors are present.
This is more of a debugging strategy for sessions than a solution.