How to change session engine in OpenCart
14 Jul


Opencart 3
Open /system/config/default.php file and change the param called 'session_engine'.
// Session
$_['session_engine'] = 'db';
Possible values:
- db – sessions are stored in the database, oc_session table;
- file – sessions are stored in a directory specified in DIR_SESSION constant in the config.php.
Opencart 2.3
Open /system/framework.php and find this line:
$session = new Session();
And modify it:
$session = new Session('file');
Possible values:
- db – sessions are stored in the database, oc_session table. Actually doesn't work, because corresponding driver wasn't finished and requires further development;
- file – session are stored in a directory specified in session.save_path param in PHP configuration;
- native – session are stored in a directory specified in session.save_path param in PHP configuration.
1 Comment(s)
Hope you do well, Stand For Ukraine!
I have fall back from OC3 to OC2.3, just install the extension with DB
I try to modified to $session = new Session('file');
Problem detected! Session directory is not writable. This may cause expired sessions can not be deleted. Contact host support to clarify.
Where to correct this issue
thanks
Tony
Leave a Comment