lord / middleman-php

Parse PHP files in Middleman
MIT License
35 stars 9 forks source link

Share sessions between pages #16

Closed mcavallo closed 8 years ago

mcavallo commented 9 years ago

At the moment It's not possible to share a session between different pages which is completely understandable given how the PHP code is executed.

We came up with a way to address this while implementing a CSRF check today which is perfect to run the code in development. Which is setting the session ID for all PHP requests directly inside the middleware before anything gets executed and using the same session_id every time:

session_id("middleman")

I wanted to check with you if you are interested on having this feature as part of the extension as we wrote most of the code already.

lord commented 9 years ago

:+1: yea, definitely! Like everything in middleman-php, it sounds incredibly hacky :smile: so some nice documentation in the README along with the feature would be probably a decent idea, but yea!

mcavallo commented 9 years ago

hehe indeed :smile: Will tidy up what we have and prepare the documentation as well.

lord commented 9 years ago

Also, @mcavallo I've added you as a collaborator — feel free (although don't feel obligated whatsoever! just thought I'd reduce friction) to merge PRs, close issues, and make changes, and LMK if you need a release cut for RubyGems.

mcavallo commented 9 years ago

Awesome! Thank you, I will be more than happy to keep the contributions coming whenever I find the time :smile:

jamonholmgren commented 9 years ago

:+1:

mcavallo commented 8 years ago

Added hacky shared sessions in 140718250630adf7785787608b1ad93148d0e275. Gonna try It out with a few test cases and report back any issues. Closing this for now.