我使用子域通配符来创建用户特定页面,例如{slug} .mysite.com
用户可以从mysite.com导航到{slug} .mysite.com
但是我似乎对这两个路由/域有不同的登录会话。
Route::group(['domain' => '{slug}.mysite.com'], function()
{
Route::get('/', 'PagesController@showByUsername');
Route::get('/plans/{plan}', 'PlansController@showslug');
Route::controllers([
'auth' => 'Auth\AuthControllerClient'
]);
});
答案 0 :(得分:2)
这是因为cookie特定于子域。
这是来自config / session.php
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
您需要将此值设置为包含所有子域的内容。