php-runtime / runtime

A home for runtimes.
MIT License
401 stars 32 forks source link

[Swoole] Support Symfony Session #60

Closed ad3n closed 3 years ago

ad3n commented 3 years ago

When using Swoole, we need to maintain session (cookie)

Ref: https://github.com/k911/swoole-bundle/blob/develop/src/Bridge/Symfony/HttpFoundation/Session/SetSessionCookieEventListener.php

Nyholm commented 3 years ago

That should definitely be added. Could we do something similar as @alexander-schranz did for RoadRunner?

https://github.com/php-runtime/runtime/pull/47

ad3n commented 3 years ago

@Nyholm i think yes. when we use runtime, may we need to do different that the bundle do for session

alexander-schranz commented 3 years ago

There is sure something similar needed which we had done for Roadrunner. I'm currently working to fix this Problem in a more general way in Symfony directly so we maybe don't need longer handle any sessions things here in the runtime for Symfony based Application: https://github.com/symfony/symfony/pull/41390

t-richard commented 3 years ago

FYI I think I had the same problem with the bref Runtime last time I tried it.

Let me know if there is a way to help move this (and https://github.com/symfony/symfony/pull/41390) forward.

alexander-schranz commented 3 years ago

@t-richard currently the CI is failing because of the deprecated AbstractTestSessionListener.php. I'm not sure what the correct way is to solve this issue (https://github.com/symfony/symfony/pull/41390#issuecomment-905424771). As I think it maybe should not longer register the TestSessionListener as its know deprecated but I'm not sure how the handle that, if you have any idea let me know I added also a comment to the symfony PR.

Nyholm commented 3 years ago

This is fixed using symfony/http-kernel 5.4 or 6.0 and the latest (unreleased) version of the runtime. Please confirm so we can close this issue.

alexander-schranz commented 3 years ago

Tested the Symfony Demo with Symfony 5.4 and dev-main with Swoole and did work for me 🎉

Nyholm commented 3 years ago

Awesome!