0
I’m looking to log in to a users.meudominio.com subdomain. To test the session, I’m just displaying what I type in the login field on the screen with the code in the controller:
if($request->session()->has('session_login'))
return view("welcome", ["session_login" => $request->session()->get('session_login')]);
After that a simple {{ $session_login }} displays correctly what I typed. But I also want to use this same session in the Clinic.domain.com subdomain, but it’s not working. I put the following code in the controller of this second subdomain:
if($request->session()->has('session_login'))
View::share('session_login', $request->session()->get('session_login'));
else
View::share('session_login', "BBB");
But it always displays only "BBB" in the second subdomain. I’ve already configured the file Sessions.php in both applications, putting 'domain' => ".i9technology.com.br"
, and I’m also using Homestead. What’s missing for this session to work in both subdomains?
Friend I think this article will help you: https://medium.com/@pagcosma/multi-subdomain-Sessions-in-Laravel-40fd31b199fa
– Kayo Bruno