GithubHelp home page GithubHelp logo

Comments (5)

bkonkle avatar bkonkle commented on June 12, 2024

I believe this is an issue related to my specific production configuration, and not with django-balancer itself. Switching to PinningCookieMiddleware resolved the issue for my app. If anyone runs into this issue out in the wild, please reopen this issue so that I can look into it further.

from django-balancer.

mkai avatar mkai commented on June 12, 2024

I had this issue once yesterday shortly after restarting the application server. Could it be that the session data is being deleted or invalidated upon app shutdown? I'm using Django 1.4's signed_cookies session engine as the backend.

from django-balancer.

umbrae avatar umbrae commented on June 12, 2024

For the record, we're having this issue at Readability. It appears to be happening sporadically on things that explicitly have no session to start (Like curl, pingdom hits, etc).

We're going to try the Cookie middleware and see how that fares.

from django-balancer.

umbrae avatar umbrae commented on June 12, 2024

Thanks. Switching to the Cookie middleware also solved it for us, and is serviceable for our needs. Thanks for providing this library.

from django-balancer.

declanshanaghy avatar declanshanaghy commented on June 12, 2024

The reason this happens is because the order of the middleware is important.
During the request the Django session middleware must execute first in order to add the session object to the request.

Ensure that middleware is loaded in this order:

...
    # SessionMiddleware must be before PinningSessionMiddleware
    'django.contrib.sessions.middleware.SessionMiddleware',
    # Pin DB reads to the master DB after write.
    'balancer.middleware.PinningSessionMiddleware',
...

from django-balancer.

Related Issues (11)

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.