User Authentication Across Subdomains on Localhost

烂漫一生 提交于 2019-12-20 01:39:56

问题


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:


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



来源:https://stackoverflow.com/questions/24214375/user-authentication-across-subdomains-on-localhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!