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

- Thread: https://externals.io/message/100841
- Original archive: https://news-web.php.net/php.internals/100841
- Started by Nicolas Grekas on 2017-10-09T11:20:30+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #100841 — Nicolas Grekas — 2017-10-09T11:20:30+00:00

URL: https://externals.io/message/100841#100841

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

---

## #100842 — Dan Ackroyd — 2017-10-09T14:28:56+00:00

URL: https://externals.io/message/100841#100842 · In reply to: #100841

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

---

## #100843 — Niklas Keller — 2017-10-09T15:47:14+00:00

URL: https://externals.io/message/100841#100843 · In reply to: #100841

>
> 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

---

## #100872 — bjorn.x.larsson@telia.com — 2017-10-12T12:06:37+00:00

URL: https://externals.io/message/100841#100872 · In reply to: #100841

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

---

## #100903 — Stanislav Malyshev — 2017-10-15T22:20:19+00:00

URL: https://externals.io/message/100841#100903 · In reply to: #100841

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
