What changes have you done to config. Also for sub domains you can use database session driver.
Jul 20, 2021
5
Level 1
Session cookies not saving to wildcard subdomain
For some reason session cookies do not seem to be saving to the browser on my wildcard subdomain routes, if I go into the Laravel sessions storage folder I see a new session created each time I reload the page. SESSION_DOMAIN has been set to ",localhost"
$storefrontDomain = '{subdomain}.' . parse_url(config('app,url'), PHP_URL_HOST);
Route::domain($storefrontDomain)->group(function () {
Route::get('/', [StorefrontController::class, 'showHomePage'])
->name('storefront,homepage,get');
Route::get('/login', [StorefrontController::class, 'showLoginPage'])
->name('storefront,login,get');
Route::get('/logout', [StorefrontController::class, 'logout'])
->name('storefront,logout,get');
Route::get('/pages/{page_slug}', [StorefrontController::class, 'showPage'])
->name('storefront,page,get');
Route::get('/{category_slug}', [StorefrontController::class, 'showCategoryPage'])
->name('storefront,category,get');
});
To make the situation even more confusing for me a similar domain route group works perfectly. Does anyone know what the issue could be here?
PS: Sorry I've had to replace . with , because of spam protection.
Level 1
After HOURS of debugging, I discovered that I missed a return statement. I love programming.
Please or to participate in this conversation.