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

371
Visualizações
How can i access all the session stored on the server?

I am trying to understand sessions. I know their purpose and i know that they are saved on the server. Now, i'd like to "see" them so i can see what informations they contain. Is there a way to access the sessions on the server as i can see the cookies with a browser ?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Assuming you're using express-session, you look in req.session on an incoming request for a particular user. You put something into a session by assigning properties to req.session on an incoming request. And, then on future requests whatever data on put in the session will be in req.session on future requests.

If you want to just examine everything in the session store, then you have to go to the interface for whatever session store you're using and use that. If you haven't selected a specific session store when configuring express-sesssion, then it's using the memoryStore.

To have general access to the session store, you'd have to create your own session store, save it somewhere and then provide it to the express-session initialization options.

Within a given request req.sessionStore is the active session store object which has an interface documented in the express-session doc. But, inside a specific request, you would usually just access req.session to access the current user's session data.

If you want to know more about how any of the dozens of supported session stores work, you'd have to console their doc/code.

over 4 years ago · Santiago Trujillo Relatório
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