Giter Club home page Giter Club logo

Comments (3)

petefredricks avatar petefredricks commented on September 26, 2024

Was there ever a solution to this? I seem to have exactly the same setup and the same issue.

from connect-mongostore.

sampov2 avatar sampov2 commented on September 26, 2024

I don't think there was ever a solution for the module itself. In my case, I made a small middleware to make sure there is no concurrency in the session middleware for the first request.

The middleware is divided into two parts surrounding express.session() in the middleware chain. There are three stages of work: "no requests", "queue" and "normal operations". Both parts share the stage and queue variables.

The first part works as follows:

  • When in "no requests", it will switch to the "queue" stage and call next().
  • In the "queue" stage, the next functions passed to the this middleware is pushed into the queue but not executed.
  • In "normal operations", next() is called

The second part works as follows:

  • If there are queued functions, call each one emptying the queue
  • Set stage to "normal operations"
  • Call next()

from connect-mongostore.

petefredricks avatar petefredricks commented on September 26, 2024

Makes sense, thanks.

from connect-mongostore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.