R
R
RoffDaniel2020-09-07 10:50:30
Laravel
RoffDaniel, 2020-09-07 10:50:30

How to transfer the data of an authorized user to all pages of the project?

Hello. My project is running on Laravel 7.x and has two groups of domains: the main domain is domain.com and the third level subdomain is subdomain.domain.com. Authorization happens here - subdomain.domain.com/login. But, if I log into the account, then the class {{ Auth::user() }}is available only on the subdomain. How can it, so to speak, "share" it into other groups / pages?

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Barmunk, 2020-09-07
@RoffDaniel

try specifying the subdomain explicitly

//  config -> session.php
'domain' => env('SESSION_DOMAIN', null),

// ENV
SESSION_DOMAIN=.domain.com

Then clear your cookies and log in again.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question