-
-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Package version
7.7.0
Describe the bug
Session cookies are not deleted when the browser is closed even though the clearWithBrowser option is enabled in the Adonis configuration file config/session.ts.
I ran a few tests and it seems that the default value set for maxAge in http-server/src/define_config.ts on line 59 is responsible.
cookie: {
maxAge: '2h', // <- I think this default value is the problem
path: '/',
httpOnly: true,
secure: true,
sameSite: 'lax' as const,
},
As long as we specify a maxAge attribute with a value other than undefined in the options for the cookie to be created or in the config/app.ts file, everything works fine. But if we give maxAge = undefined as an option for our cookie, the value is overwritten by the one defined in http-server/src/define_config.ts.
As a result, it is not possible to create cookies that will be deleted when the browser is closed.
I am at your disposal for any further information you may require.
Reproduction repo
No response