Auth session is unset after auth then the application redirect


Okay so if you set sameSite: false inside config/session.js file, it works in chrome too.

Finding more details on understand how chrome justifies this


@virk That’s the solution. I think you should put a note for this pending when you fix this.


May you create a PR ?


Not sure if a PR is needed @romain.lanz … This issue is only happening to chrome. Firefox or Safari is working fine.


Sorry to open old discussion!

I literally spent 3 hours finding out why it does the same thing to me too! I haven’t tried to used any other browser.

It was indeed weird when I logged in user and then redirected it to another view, the session just gone, however instead of return response.redirect(..) to return 'works' was working fine!

This should be put in a documentation as a hint!!


@Tsume what are you trying to do? did you try it on other browsers?


@iamraphson - I was trying to set social auth, but for some reason the session was lost.

I did the same what @virk suggested. sameSite set to false and it works fine!

I believe this should be put in a doc :joy:


I updated the config file to have sameSite: false by default now. Yeah but having in docs is fine too


Hi Virk,

I am facing the same issue on 71.0.3578.98, IE 11 & FF
Not sure how to fix the issue.

I followed the suggestion of changing the sameSite: false but its not working
Appreciate your help.

------------------ Error extracted ----------------

0|server | InvalidSessionException: E_INVALID_SESSION: Invalid session
0|server | at Function.invoke (/var/www/l_and_ls/node_modules/@adonisjs/auth/src/Exceptions/index.js:210:12)
0|server | at SessionScheme.check (/var/www/l_and_ls/node_modules/@adonisjs/auth/src/Schemes/Session.js:330:38)
0|server | at SessionScheme.getUser (/var/www/l_and_ls/node_modules/@adonisjs/auth/src/Schemes/Base.js:215:16)
0|server | at DashboardController.redirectToMyDashboard (/var/www/l_and_ls/app/Controllers/Http/DashboardController.js:18:33)
0|server | at Server._routeHandler (/var/www/l_and_ls/node_modules/@adonisjs/framework/src/Server/index.js:121:31)
0|server | at MiddlewareBase._resolveMiddleware (/var/www/l_and_ls/node_modules/@adonisjs/middleware-base/index.js:195:28)
0|server | at Runnable._invoke (/var/www/l_and_ls/node_modules/@adonisjs/middleware-base/node_modules/co-compose/src/Runnable.js:76:42)
0|server | at once (/var/www/l_and_ls/node_modules/@adonisjs/middleware-base/node_modules/co-compose/src/Runnable.js:73:34)
0|server | at f (/var/www/l_and_ls/node_modules/once/once.js:25:25)
0|server | at Acl.handle (/var/www/l_and_ls/app/Middleware/Acl.js:56:23)
0|server | at
0|server | at process._tickCallback (internal/process/next_tick.js:189:7)