【问题标题】:php artisan serve new session every requestphp artisan 为每个请求提供新会话
【发布时间】:2014-04-07 14:14:20
【问题描述】:

在我的本地机器上,为了开发,我正在运行 WAMP,有时在开发时使用 php artisan serve 来运行我的应用程序。

我发现每个页面请求都在 app/storage/sessions 中创建了一个新的 sessionId。无论出于何种原因,只有当我使用 artisan serve 并在 localhost:8000 上点击应用程序时才会发生这种情况。当我通过我的 webapps 目录 projectname/public 的 apache 地址时,会话将按预期保留。

我首先注意到的问题是当我添加 csrf 令牌并在提交表单时出错。

知道为什么吗?

【问题讨论】:

    标签: session laravel


    【解决方案1】:

    我也有同样的问题,下面是我用来解决的问题。 我在

    中创建了新的虚拟主机
    • C:\Windows\System32\Drivers\etc\hosts
    • 转到 C:\wamp\bin\apache\Apache2.4.4\conf\httpd.conf 并取消注释此 Include conf/extra/httpd-vhosts.conf
    • 然后去配置我的虚拟主机像

    ServerAdmin webmaster@virtualhost.com DocumentRoot "C:/wamp/www/virtualhostwebsitefolder" 服务器名称 ngosfunds.com 错误日志“logs/ngosfunds.com-error.log” CustomLog "logs/ngosfunds.com-access.log" common

    【讨论】:

    • 我遇到了类似的问题,但是浏览器同步(stackoverflow.com/questions/30391280/…)我想试试你的方法,看看它是否有助于解决问题。但我不明白最后一部分 - then went and configured my virtualhost like...。希望你能为像我这样的初学者解释更多细节。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2021-06-15
    • 1970-01-01
    • 2016-08-07
    • 2011-05-15
    • 2017-06-17
    • 1970-01-01
    • 2016-11-17
    • 2021-10-20
    相关资源
    最近更新 更多