用户身份验证跨子网域在localhost [英] User Authentication Across Subdomains on Localhost

查看:208
本文介绍了用户身份验证跨子网域在localhost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要建在我的本地应用程序。当我通过一个子域,登录(如sub.localhost /)我需要访问登录的用户与验证::我的应用程序的所有其他子域(如sub2.localhost /,sub3.localhost /).

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/).

我所做的更改为<一个href=\"http://stackoverflow.com/questions/22284173/laravel-4-authentication-not-working-with-subdomains\">this后在建议配置/ session.php文件:

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.

推荐答案

您是否尝试过与一个只有.localhost代替.localhost /

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

如果它仍然不工作,你可以创建一个其他主机指向127.0.0.1:编辑/ etc / hosts或WINDOWS \\ SYSTEM32 \\ DRIVERS \\ ETC \\主机设置其他主机,例如:127.0.0.1 host.loc

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

这篇关于用户身份验证跨子网域在localhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆