【发布时间】:2018-09-16 03:39:03
【问题描述】:
我正在尝试提交登录页面,以便我可以访问。它处于生产阶段。在 localhost 中它工作得很好,但是在托管时在线它会带来这个错误
页面由于不活动而过期。请刷新并重试。
我的登录页面:
@extends('layouts.app')
@section('content')
<!-- begin login -->
<div class="login bg-black animated fadeInDown">
<!-- begin brand -->
<div class="login-header">
<div class="brand">
<!-- <span class="logo"></span> Color Admin -->
AGPAHI
<small>Reporting Portal</small>
</div>
<div class="icon">
<i class="fa fa-sign-in"></i>
</div>
</div>
<!-- end brand -->
<div class="login-content">
{{-- <img src="{{ asset('img/AGPAHI.png') }}"><br/> --}}
<form class="margin-bottom-0" method="POST" action="{{ route('login') }}">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group m-b-20">
<input type="text" name="email" id="email" class="form-control input-lg inverse-mode no-border" placeholder="Email Address" required autofocus/>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
<div class="form-group m-b-20">
<input type="password" class="form-control input-lg inverse-mode no-border" name="password" placeholder="Password" required />
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
<div class="checkbox m-b-20">
<label>
<input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Remember Me
</label>
</div>
<div class="login-buttons">
<button type="submit" class="btn btn-success btn-block btn-lg">Login</button>
<a class="btn btn-link" href="{{ route('password.request') }}">
Forgot Your Password?
</a>
</div>
</form>
</div>
</div>
<!-- end login -->
@endsection
我做了什么: 1) 在表单中添加 csrf 令牌 2) 改变存储路径的写权限
可能是什么问题?
【问题讨论】:
-
检查您在登录页面上获得的会话 cookie,并确保您发送的表单提交是相同的。如果不是,那么您的 cookie 设置中可能设置了一些奇怪的路径或主机。
-
@apokryfos,感谢您的提醒,没有意识到这是输出!
标签: php laravel csrf laravel-5.5