(05-03-2024, 08:29 PM)kenjis Wrote: The actual code for sessions in CI3 must be modified in order to read CI4 session data.
Thank you for that clarification. We were able to get this to work by modifying the CI4 code. CI4 was adding a prefix to the session id which CI3 was not. In our case we use the database handler so we were able to modify this code in CI4 system/Session/Handlers/DatabaseHandler:
// Add sessionCookieName for multiple session cookies.
$this->idPrefix = $config->cookieName . ':';
to this:
$this->idPrefix = '';
After that the sessions were getting identified/stored with the same id's and both CI3 and CI4 could read the session.
I did not determine if the session info is being stored in an encrypted format but I changed all the settings in the CI4 app/Config/Encryption.php file to those that the comments said were compatible with CI3, and used the encryption key that was in the CI3 config files.