Answer the question
In order to leave comments, you need to log in
Am I catching the beginning of the session correctly?
There is a site with a long history, rewritten separately on a new server. It was necessary that after logging in on the old site, authorization would automatically take place on the new one. We decided to do this: when entering a new site, a new session is caught and it is checked if there is a cookie, then get the information and authorize using Laravel.
I implement it like this: I
created a Middleware "StartSession" with inheritance from the parent Illuminate\Session\Middleware\StartSession and rename the startSession method to :
public function startSession(Request $request)
{
event(new SiteAuth($session=parent::startSession($request)));
return $session;
}
Answer the question
In order to leave comments, you need to log in
event(new SiteAuth($session=parent::startSession($request)));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question