-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SessionMiddleware can not work on swoole #25
Comments
Do you want to keep session in the worker context and not to destroy/recreate it on each request? |
No, I will create a new PsrRequest instance on each request and this is not my point. if ($requestSessionId !== null && $this->session->getId() === null) {
$this->session->setId($requestSessionId);
} will modify session singleton and never execute |
Wait, but $requestSessionId = $this->getSessionIdFromRequest($request); |
Yes, request is different. |
You're right. Any fix that comes in mind? I don't currently have Swoole environment set up :( |
As I mentioned in the question, we should use the code |
Make public function setId(?string $sessionId): void
{
$this->sessionId = $sessionId;
} And we should add |
I think it won't work well. |
@ChisWill ping us if it doesn't help please. |
I refer to this article, but I found that in the same process |
Hi guys,my application run with swoole, I found I can not use SessionMiddleware because Session will be overwrite by other request.
Could we add Session into attribute of request, so we can use the way
$request->getAttribute(SessionInterface::class)
to get Session.We also can remain old usage by add a new property when application running different env.
Funding
The text was updated successfully, but these errors were encountered: