There are two different projects which have developed on codeigniter. I want to share session storage between these projects. $config['sess_cookie_name'] = 'ci_session';
config file is same in both. But when I refresh one of them, all data automatic remove from another project. I can't solve this problem. #help
Store sessions in a central database; use the same session table for different projects.
See https://codeigniter.com/user_guide/libraries/sessions.html#database-driver
Addendum:
Codeigniter (CI) employs a number of ways to store sessions. Flat file, database, Redis etc. Default is flat file; ie; stores session data within the filesystem.
It is also possible to store the sessions in database tables. This method facilitates both multi server and multi project installations.
application/config/config.php does have a section named "Session Variables".
$config['sess_driver'] = 'database'; <- use database
$config['sess_save_path'] = 'ci_sessions'; <- use this table
shared usage of this table for session storage among different projects will solve the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With