-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
laravel can be use session login? #1
Comments
Not in Symfony demo. We are fixing it. |
I'm testing with Laravel Orchid admin, and it's working. |
Fixed in Symfony and Laravel. |
good job. maybe we can close project laravel-octane-workerman。 |
Why create a lib for only 1 framework, when we can create one (Adapterman) that we can use with almost any framework or app. Only one lib to maintain, for all the frameworks. |
After more checking, work but not correctly. I'm now trying to fix it. From the Laravel side. So we'll need to add 2 lines of code for clean the session, in any new request. |
From @493226876
How do you set up the session and auth in Laravel, will be a problem with any worker mode: adapterman, laravel-swoole, Octane, .... You can't do that, in any worker mode: namespace App\Http\Controllers;
class TestController extends Controller
{
protected $userId;
public function __construct()
{
// Wrong usage: Since the controller is only constructed once and then resident in memory, $userId will only be assigned once, and subsequent requests will be misread before requesting $userId
$this->userId = session('userId');
}
public function testAction()
{
// read $this->userId;
}
} Corect: namespace App\Http\Controllers;
class TestController extends Controller
{
protected function getUserId()
{
return session('userId');
}
public function testAction()
{
// call $this->getUserId() to read $userId
}
} This week, I'll try with Shared Nothing mode, that for sure will work. But the performance will be in the middle of php-fpm and worker mode. The problem is from the Laravel side. And we are talking with Laravel devs to clean the session and auth in each request, but from the Laravel side. |
No description provided.
The text was updated successfully, but these errors were encountered: