CodeIgniter Forums
CI4 Session File Handler issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: CI4 Session File Handler issue (/showthread.php?tid=79735)



CI4 Session File Handler issue - LynxCoder - 07-24-2021

Hi all,
I have a somewhat odd problem with Sessions.  I am using the latest version of CI4, and the session handler in the .ENV is set to use the file handler.

Not every page, but sometimes, (especially if the page is refreshed) I get a Fatal Error....
Fatal error: Uncaught ErrorException: touch(): Unable to create file NULL/ci_session5oabivgbpg3ouudg0op9746292et2ql9

Now if I echo WRITEPATH I get the website root/writable - which is accurate and correct, but the file handler is putting the session files into /public/NULL/ and I am struggling to understand why. I haven't touched or replaced the session handler, nor the path to which it uses.

The writable folder contains a folder called Sessions, which have been chmod'ed to the correct values, but CI isn't using it. Can any one offer any suggestions as to what is happening, and more importantly how to correct it. I have had a search around, but haven't found anything.  If the worst comes to the worst, I'll change to the database handler.

Richie


RE: CI4 Session File Handler issue - paulbalandan - 07-24-2021

Set a valid path to save your sessions. Currently, you set it to the string 'NULL'


RE: CI4 Session File Handler issue - LynxCoder - 07-24-2021

(07-24-2021, 09:14 AM)paulbalandan Wrote: Set a valid path to save your sessions. Currently, you set it to the string 'NULL'

Thanks - what a idiot!  I'd assumed as CI created a Sessions folder within the writable folder that it was pointed there, and I left that line commented out of the .ENV!  All changed now.

Rich