php - 将项目 Laravel 上传到共享主机(Cpanel)时出现“页面已过期”错误
问题描述
将我的 Laravel 项目上传到共享主机后出现问题。当我通过 Xampp(Localhost) 测试时一切正常。但是在共享主机的生产中,我在每个表单上单击“提交按钮”-> 出现:`页面已过期。尽管我已经Csrf_token
并且已经搜索了很多关于我的问题的问题,但我无法解决它。请帮我!!!
这是我的表格:
<form action="{{ route('login') }}" method="post" autocomplete="off">
@csrf
<div class="form-group">
<label for="nrp">NRP</label>
<input class="form-control @error('nrp') is-invalid @enderror" type="number" name="nrp" id="nrp" autofocus required>
@error('nrp')
<span class="invalid-feedback" role="alert">
<strong>NRP / Password yang dimasukan salah!</strong>
</span>
@enderror
</div>
<div class="form-group">
<label for="password">Password</label>
<input class="form-control" type="password" name="password" id="password" required>
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="d-flex mb-5 mt-2 align-items-center">
<label class="control control--checkbox mb-0">
<span class="caption">Remember me</span>
<input type="checkbox" name="remember" />
<div class="control__indicator"></div>
</label>
<span class="ml-auto">
<a href="{{ route('user.register') }}" class="forgot-pass">Register Account</a>
</span>
</div>
<input type="submit" value="Log In" class="btn btn-block btn-primary">
</form>
路线:
Auth::routes(['verify' => true]);
我正在使用laravel/ui
身份验证。
请检查网站以获取错误示例http://etwpad.id/login
解决方案
Try creating an application key.
Run php artisan key:generate
. This will create a key and place it in your .env
file (APP_KEY
).
Then php artisan config:cache
. This will clear you cache for use of the new key.
推荐阅读
- php - 如何在查询日期中添加天数?拉拉维尔
- reporting-services - 在 SSRS 中的单个数据库调用中生成多种格式的报告
- r - 如何在 tibble 中查看列表项
- javascript - 申请加拿大的折扣和免税计算
- jquery - 无法通过 Put 请求从表单接收数据 - Laravel
- android - Jetpack Compose 中的共享表
- reactjs - 使用 ReactJs 从数值数组中返回偶数
- apache-spark - Spark - 如何使用窗口函数获取前一个值的所有列
- javascript - 将值/变量传递给异步函数
- kotlin - How to add retrofit service interface function paramter to data class member using moshi?