douren5490 2019-03-27 00:07
浏览 62

Laravel 5.8会话在Git Branch结账后没有写入cookie

I have a team who are developing a Laravel app. We are at the early stages so almost no code has been written. One of my teammates ran the ‘php artisan make:auth’ command on his branch to activate authentication which worked fine and continues to work on their machine.

Once I did a checkout on this branch however, I would attempt to login and would get a “419-page expired” error in spite of it working on my team mates machine. After some research I found that there is no cookie being saved for the session. Instead, each time a page request is made, a new file is created in storage/frameworks/sessions.

My project has the following details:

  1. storage folder has correct permissions to read and write
  2. All csrf tokens are in place in the auth files.
  3. Session.php hasn’t been touched from the default

Any suggestions about what could cause this would be much appreciated.

  • 写回答

1条回答 默认 最新

  • duanjuduo4573 2019-07-03 10:55
    关注

    We had the same issue. Check all files for extra chars before php opening tag, especially for invisible one. In our case the reason was in invisible symbol (UTF BOM) in one of config files. Notepad++ and PHPStorm do not show it! We can detect it only with FAR editor! PHP and Laravel show no warnings about it (it is strange), but http response header with cookies is broken.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分