User Authentication Across Subdomains on Localhost

2019-02-24 11:02发布

I'm building an app on my localhost. When I login via one subdomain, (e.g. sub.localhost/) I need to access that logged-in user with Auth:: in all other subdomains of my application (e.g. sub2.localhost/, sub3.localhost/).

I made the change as this post suggests in config/session.php:

'domain' => '.localhost/',

No beans. In fact now I can't log in at all. Does this only work with a non-localhost domain? That would suck.

1条回答
啃猪蹄的小仙女
2楼-- · 2019-02-24 11:39

Did you try with only .localhost instead of .localhost/

if it is still doesn't work you can create an other host pointing to 127.0.0.1 : edit the /etc/hosts or Windows\System32\drivers\etc\hosts to set an other hostname for example : 127.0.0.1 host.loc

查看更多
登录 后发表回答