Home > Enterprise >  Session management in Typescript with express
Session management in Typescript with express

Time:12-28

Hello I am new to typescript. And want to know how session is managed in Typescript. Like session initialisation, storing user data in session etc etc. So if any one having tutorial or documention on that you can share.

Thank you

CodePudding user response:

You can do it all manually or use library. If you are doing it first time in your life I recommend to write it from scratch, to learn, but on production let use package.

For example:

https://www.passportjs.org/

It has:

  • plugins to express
  • support for typescript @types/passport
  • handle sessions passport-session stored in different places

You can start from reading this article:

https://medium.com/@sherief.elsowiny/how-to-build-a-session-authentication-system-in-express-typescript-c48d561d7178

and create new more specific question if something will be unclear.

  • Related