Welcome Guest, Not a member yet? Register   Sign In
Session File Handler
#1

Hello, I'm creating an API to upload a file and I'm having problems creating session. I've already changed the permissions of the folders under "writable" and "public" to 777 and changed their owner to www-data.Greatful. 

My .env file
app.sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'
app.sessionCookieName = 'vulcan_session'
app.sessionExpiration = 7200
app.sessionSavePath = NULL
app.sessionMatchIP = false
app.sessionTimeToUpdate = 300
app.sessionRegenerateDestroy = false

security.tokenName = 'vulcan_token'
security.headerName = 'X-CSRF-TOKEN'
security.cookieName = 'vulcan_cookie'
security.expires = 7200
security.regenerate = true
security.redirect = true
security.samesite = 'Lax'

The error:
{
    "title": "ErrorException",
    "type": "ErrorException",
    "code": 500,
    "message": "mkdir(): Permission denied",
    "file": "/var/www/html/sistema/system/Session/Handlers/FileHandler.php",
    "line": 112,
    "trace": [
        {
            "function": "errorHandler",
            "class": "CodeIgniter\\Debug\\Exceptions",
            "type": "->"
        },
        {
            "file": "/var/www/html/sistema/system/Session/Handlers/FileHandler.php",
            "line": 112,
            "function": "mkdir"
        },
        {
            "function": "open",
            "class": "CodeIgniter\\Session\\Handlers\\FileHandler",
            "type": "->"
        },
        {
            "file": "/var/www/html/sistema/system/Session/Session.php",
            "line": 931,
            "function": "session_start"
        },
        {
            "file": "/var/www/html/sistema/system/Session/Session.php",
            "line": 245,
            "function": "startSession",
            "class": "CodeIgniter\\Session\\Session",
            "type": "->"
        },
        {
            "file": "/var/www/html/sistema/system/Config/Services.php",
            "line": 706,
            "function": "start",
            "class": "CodeIgniter\\Session\\Session",
            "type": "->"
        },
        {
            "file": "/var/www/html/sistema/system/Config/BaseService.php",
            "line": 256,
            "function": "session",
            "class": "CodeIgniter\\Config\\Services",
            "type": "::"
        },
        {
            "file": "/var/www/html/sistema/system/Config/BaseService.php",
            "line": 190,
            "function": "__callStatic",
            "class": "CodeIgniter\\Config\\BaseService",
            "type": "::"
        },
        {
            "file": "/var/www/html/sistema/system/Config/Services.php",
            "line": 692,
            "function": "getSharedInstance",
            "class": "CodeIgniter\\Config\\BaseService",
            "type": "::"
        },
        {
            "file": "/var/www/html/sistema/system/Config/BaseService.php",
            "line": 256,
            "function": "session",
            "class": "CodeIgniter\\Config\\Services",
            "type": "::"
        },
        {
            "file": "/var/www/html/sistema/system/HTTP/RedirectResponse.php",
            "line": 81,
            "function": "__callStatic",
            "class": "CodeIgniter\\Config\\BaseService",
            "type": "::"
        },
        {
            "file": "/var/www/html/sistema/system/Filters/CSRF.php",
            "line": 59,
            "function": "back",
            "class": "CodeIgniter\\HTTP\\RedirectResponse",
            "type": "->"
        },
        {
            "file": "/var/www/html/sistema/system/Filters/Filters.php",
            "line": 177,
            "function": "before",
            "class": "CodeIgniter\\Filters\\CSRF",
            "type": "->"
        },
        {
            "file": "/var/www/html/sistema/system/CodeIgniter.php",
            "line": 391,
            "function": "run",
            "class": "CodeIgniter\\Filters\\Filters",
            "type": "->"
        },
        {
            "file": "/var/www/html/sistema/system/CodeIgniter.php",
            "line": 324,
            "function": "handleRequest",
            "class": "CodeIgniter\\CodeIgniter",
            "type": "->"
        },
        {
            "file": "/var/www/html/sistema/public/index.php",
            "line": 37,
            "function": "run",
            "class": "CodeIgniter\\CodeIgniter",
            "type": "->"
        }
    ]
}
Reply


Messages In This Thread
Session File Handler - by wspock - 07-09-2021, 08:01 AM
RE: Session File Handler - by includebeer - 07-09-2021, 09:25 AM
RE: Session File Handler - by wspock - 07-09-2021, 12:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB