lonnieezell / myth-auth

One-stop Auth package for CodeIgniter 4
MIT License
632 stars 207 forks source link

Codeigniter v4.4.0 changes: cookie config now in Cookie.php not App.php #606

Closed gazer22 closed 8 months ago

gazer22 commented 11 months ago

Codiegniter v4.4.0 moved cookie configuration from App.php to Cookie.php

Suggested fix in AuthenticationBase.php::rememberUser: ` // Save it to the user's browser in a cookie. $appConfig = config('Cookie'); $response = service('response');

    // Create the cookie
    $response->setCookie(
        'remember',                         // Cookie Name
        $token,                             // Value
        $this->config->rememberLength,      // # Seconds until it expires
        $appConfig->domain,
        $appConfig->path,
        $appConfig->prefix,
        $appConfig->secure,                 // Only send over HTTPS?
        true                                // Hide from Javascript?
    );`

and AuthenticationBase.php::refreshRemember: ` $appConfig = config('Cookie');

    // Create the cookie
    set_cookie(
        'remember',                             // Cookie Name
        $selector . ':' . $validator,           // Value
        (string) $this->config->rememberLength, // # Seconds until it expires
        $appConfig->domain,
        $appConfig->path,
        $appConfig->prefix,
        $appConfig->secure,                     // Only send over HTTPS?
        true                                    // Hide from Javascript?
    );

`

manageruz commented 11 months ago

Thank you for info. We need to update some code.