gpt4 book ai didi

laravel - 我的 Laravel 5.4 登录用户 session 不会持续存在

转载 作者:行者123 更新时间:2023-12-02 01:11:18 26 4
gpt4 key购买 nike

我的应用程序遇到了这个奇怪的问题,它无法使用 Auth facade 持续登录用户 session 。例如,在我的标题 View 中,我将登录的用户数据设置为:

@if (Auth::check())
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<img src="{{route('getphoto', Auth::user()->image)}}" alt="" />
{{ Auth::user()->name }}
<span class="caret"></span>
</button>
</div>
@else
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Not Logged In
</button>
</div>
@endif

第一次登录后,标题中的已登录用户数据(如照片和姓名)将正确显示,但在我刷新或移动到另一个页面后,它们消失并表明用户未登录。我不不知道我做错了什么,我对用户登录相关功能所做的只是将电子邮件更改为用户名。我该如何解决这个问题?我正在使用 Laravel 5.4

最佳答案

您需要为 storage 目录设置正确的权限:

chmod -R 755 storage

After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server.

https://laravel.com/docs/5.4/installation

关于laravel - 我的 Laravel 5.4 登录用户 session 不会持续存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45195347/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com