A
A
ArtemSmirnov2012-08-19 12:19:30
JavaScript
ArtemSmirnov, 2012-08-19 12:19:30

connect.session: create a session as needed

I actually use the express framework , and naturally with it connect , I also use connect.session (aka express.session), and now I wanted to set up caching for guests on nginx and so that an extra entry is not created in the database for each guest, so it was decided to create session only if the user is logged into his account, how to implement this? Are there ready-made plugins for express that can do this? Or do you have to write your own?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fedor Indutny, 2012-08-19
@ArtemSmirnov

The whole express and connect is essentially a plugin library, take the middleware and wrap it in a function that will only call it under certain circumstances (for example, the presence of a Cookie).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question