Session timeout for specific users

I use cakephp/authentication for user login, can it be set for a certain user id=1 so that the session timeout is 1 week?

In the config/app.php file, I have set the session as follows

'Session' => [
    'defaults' => 'cake',
    'timeout' => 24 * 60, // 1 day
],

Thanky you

You could extend the default SessionAuthenticator, overwrite the persistIdentity method and set that new custom SessionAuthenticator inside your AuthenticationService.
Inside persistIdentity the session is actually checked and re-written.
So you could set the Session timeout config before the session is set/renewed for your specific identity.

1 Like