Reputation:
So I have a sub-domain, let's say for example:
Route::domain('test.localhost')
->group(function () {
Route::resource('test', 'Wallet\WalletController');
});
If my user is logged in a http://localhost but visits the test.localhost, it redirects them to the login page. Is it possible to keep the user logged in for sub-domains too?
Upvotes: 0
Views: 547
Reputation: 2589
Sessions are bound to domains. Under config/session.php you must have 'domain' => env('SESSION_DOMAIN', null),
.
Then put SESSION_DOMAIN=.localhost
in your .env file and it should work for all subdomains and the main domain.
Sessions can be restricted on the path also.
Upvotes: 1