Giter VIP home page Giter VIP logo

Comments (7)

dakkar avatar dakkar commented on September 2, 2024

https://gist.github.com/dakkar/5645bb54bdfa1ede08fa a small test case.

The problem does not seem to happen much with the File store, but it happen pretty reliably with the DBI store.

from plack-middleware-session.

miyagawa avatar miyagawa commented on September 2, 2024

Excellent catch. cc @alexmv

We'd either have an option to disable the behavior, or have some kind of API using special keys in $env to change the behavior in runtime - which would probably default to the before phase like we do, since updating session in the stream response sounds rarer for me.

Doing the save twice might be doable but I personally don't like it.

from plack-middleware-session.

miyagawa avatar miyagawa commented on September 2, 2024

psgix.session.options already has similar no_store which prevents updating the data for the session that doesn't need save. Can we add a new option like late_store which enables the introduced behavior, and otherwise updating before the streaming response like previously? @alexmv

from plack-middleware-session.

alexmv avatar alexmv commented on September 2, 2024

Hm. I entirely believe the race condition -- though I'm unable to duplicate it using the gist you showed. Is the got/expected failure supposed to occur without the ForceSessionSave middlware? Even with 10 parallel user agents and upping it to 5 redirects instead of three, I'm unable to get a mismatch.

I'll push a branch shortly which makes the late storage behavior contingent on a psgix.sesison.options flag.

from plack-middleware-session.

alexmv avatar alexmv commented on September 2, 2024

@dakkar, can you confirm the above branch fixes this for you?

from plack-middleware-session.

miyagawa avatar miyagawa commented on September 2, 2024

I just shipped 0.27-TRIAL with the fix.

from plack-middleware-session.

dakkar avatar dakkar commented on September 2, 2024

@alexmv confirmed, it works. thank you!

from plack-middleware-session.

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.