Skip to content

CodeIgniter\Session\Handlers\FileHandler Class and writable\session Directory not found while using .env #994

Description

@abhishekKrHaith11

I'm using : Windows 10 ( 64-bit ) with XAMPP 7.2.3

Here is my session config in .env -

app.sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'
app.sessionCookieName = 'ci_session'
app.sessionSavePath = 'C:\xampp\htdocs\develop\CodeIgniter4\writable\session'
app.sessionMatchIP = false
app.sessionTimeToUpdate = 300
app.sessionRegenerateDestroy = false

Error for session driver: Class ''CodeIgniter\Session\Handlers\FileHandler'' not found

Error for session save path: mkdir(): No such file or directory

Debug

While debugging, I found when we are using backslash within single or double quotes in .env file apache sets the value with the single or double quotes in $_ENV.

So at BASEPATH/Config\Services.php at line 709 it tries to create a object with 'CodeIgniter\Session\Handlers\FileHandler' class which does not exists.

And in BASEPATH/Session\Handlers\FileHandler.php at line 112 it tries to create a directory in a path which does not exists.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions