Session extension cannot be used in a loop/CLI since 7.2

php.internals

Nicolas Grekas

8 years ago
Hello, I'm having a hard time fixing Symfony's tests suite to 7.2 because of the added warnings+ini_set-rejections in the Session module. Testing the session on the CLI is not possible anymore without starting one PHP process per test case. Why not, you may say. BUT, this also means that the session module is now basically useless in a request-response loop. That means ReactPHP, PHP-PM, Amp & the likes are all going to have to rewrite a userland session module completely. That also means e.g. Symfony and all other frameworks will have to move away from the internal's Session module if they want to work also with these long living processing model. PHP is less "generic" now - with stronger bindings to its short lived req/resp. cycle. Is it something internal should care about? Should we reconsider this for 7.2? Regards, Nicolas

Dan Ackroyd

8 years ago
Hey Nicolas, Please could you open a bug with a reproduce case of what worked before, and what doesn't work now, so that it is clear what the change was. I wasn't aware that there was a change that would make the session handler that much harder to use outside of the single requests/response environment.
> That means ReactPHP, PHP-PM, Amp & the likes are all going to have to > rewrite a userland session module completely.
That sounds like a _fantastic_ idea long term. I have been working on that idea for a while....but keep getting distracted by various more fun activities. cheers Dan Ack

Niklas Keller

8 years ago
> > I'm having a hard time fixing Symfony's tests suite to 7.2 because of the > added warnings+ini_set-rejections in the Session module. > > Testing the session on the CLI is not possible anymore without starting one > PHP process per test case. Why not, you may say. > > BUT, this also means that the session module is now basically useless in a > request-response loop. > That means ReactPHP, PHP-PM, Amp & the likes are all going to have to > rewrite a userland session module completely.
We already have a custom session module, because the internal session module doesn't really work well for Aerys. Regards, Niklas

Björn Larsson

8 years ago
Den 2017-10-09 kl. 13:20, skrev Nicolas Grekas:
> Hello, > > I'm having a hard time fixing Symfony's tests suite to 7.2 because of the > added warnings+ini_set-rejections in the Session module. > > Testing the session on the CLI is not possible anymore without starting one > PHP process per test case. Why not, you may say. > > BUT, this also means that the session module is now basically useless in a > request-response loop. > That means ReactPHP, PHP-PM, Amp & the likes are all going to have to > rewrite a userland session module completely. That also means e.g. Symfony > and all other frameworks will have to move away from the internal's Session > module if they want to work also with these long living processing model. > > PHP is less "generic" now - with stronger bindings to its short lived > req/resp. cycle. > Is it something internal should care about? Should we reconsider this for > 7.2? > > Regards, > Nicolas >
One aspect that comes to mind is if this has a negative impact on the adaptation / uptake of 7.2 once it's released? Could be valuable to have the RMs view on this changed behaviour. r//Björn

Stas Malyshev

8 years ago
Hi!
> I'm having a hard time fixing Symfony's tests suite to 7.2 because of the > added warnings+ini_set-rejections in the Session module. > > Testing the session on the CLI is not possible anymore without starting one > PHP process per test case. Why not, you may say.
That doesn't sound good, do you have details why exactly these things do not work? Generally, I don't see why anything in sessions should not be reuseable within the context of the request.
> Is it something internal should care about? Should we reconsider this for > 7.2?
I think yes.
-- Stas Malyshev smalyshev@gmail.com