Made 2 login with session in Adonis but it has a problem in the cookie

I made 2 session scheme one for admin login and one for associate login. And the login is session based. There is separate table for the two. But when i login in admin side I will also able to go associate site without login also vice versa. One path is localhost:3333/admin and the other one is localhost:3333/associate. So if I login in same browser one session is able to continue with two type of login


I think you should make one User model + database and add separate roles for it. So single user logs in, but this user can have different roles.

Some discussions and solutions about it in here

I think it’s not possible.
You can look at this thread How to access session from edge template

We’re finding ways to customize session so that we can separate multiple sessions

make one auth with different roles:
Admin, User

Then prevent user with role User, entering Admin area.