I'm trying to debug this CodeIgniter issue I am having with my application. I cannot figure it out so I was wondering if anyone else has come across this and could shed some light on it?
This occurs randomly when a user is logged in. The user could be browsing and all of a sudden this error pops up. Refresh the browser and it's gone.
CodeIgniter 3
Thanks!
A PHP Error was encountered
Severity: Warning
Message: unlink(/tmp/ci_session0189a7f1c86eb18fb70afcfedc2d5040e9c23146): Operation not permitted
Filename: drivers/Session_files_driver.php
Line Number: 346
Backtrace:
File: /home/*****/public_html/application/controllers/User.php
Line: 5
Function: __construct
File: /home/*****/public_html/index.php
Line: 292
Function: require_once
After doing some more research I found the issue and the answer.
In the config.php file you MUST set sess_save_path
to a valid path. It was initially set to NULL. I have mine set to:
$config['sess_save_path'] = BASEPATH . 'cache/';
Now the sessions are being saved in this folder and can be unlinked when needed to.
I change on "application/config/config.php" :
$config['sess_save_path'] = NULL;
To:
$config['sess_save_path'] = APPPATH . 'cache'; (or another folder)
location folder "cache" is "application/cache".
change application > config > config.php
$config['sess_save_path'] = BASEPATH . 'cache/';
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