Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

348
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda