Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

347
Views
AdonisJS auth and session

According to the documentation :

You can logout the user by calling the auth.logout method. It will destroy the user login session and the remember me cookie. The remember me token inside the users is also set to null.

docs.adonisjs.com

AuthController.ts

  public async logout({ response, auth, session }: HttpContextContract) {
    await auth.logout()
    session.flash({ success: 'You are now logged out.' })
    return response.redirect().toRoute('login')
  }

But the remember me token in the users table is not set to null and when I log back in, the remember me token is still the same. It looks like my app is working fine. Why is that ? Is this the default behavior?

Actually, I don't understand how sessions work in AdonisJS.

Cookies in Chrome

On the first request I get the first two cookies and when I log in by checking the remember me checkbox, the last cookie appears. The first one seems to be the session id. adonis-session cookie also contains the session id. So what is the first used for and what does it contain? And what does the remember_web cookie contain?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!