You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Laravel 5.6页面因无活动过期(已含TOKEN)问题求助

Laravel 5.5 "The Page Has Expired Due To Inactivity" Issue (Token Is Present)

Hey everyone, I'm stuck on this frustrating "page expired" error in Laravel 5.5 even though the CSRF token is clearly present in my forms.

I've already dug into similar issues and tried every solution I could get my hands on—swapped cache/session drivers, double-checked form tokens, verified directory permissions, and still no luck resolving it.

What I've Tried So Far:

  • Switched CACHE_DRIVER and SESSION_DRIVER between file and database (currently set to database for both)
  • Ensured all forms include the CSRF token (using {{ csrf_field() }})
  • Confirmed storage directory permissions are set correctly:
    drwxrwxrwx 5 ABC ABC 4096 May 30 23:16 storage
    
  • Here's my current .env configuration:
    APP_NAME="Name"
    APP_ENV=staging
    APP_KEY=SOMEKEY
    APP_DEBUG=false
    APP_LOG_LEVEL=false
    APP_URL=http://url
    DB_CONNECTION=mysql
    DB_HOST=mysql.host.com
    DB_PORT=3306
    DB_DATABASE=db_name
    DB_USERNAME=db_user
    DB_PASSWORD=db_user_password
    BROADCAST_DRIVER=log
    CACHE_DRIVER=database
    SESSION_DRIVER=database
    QUEUE_DRIVER=sync
    
  • Form code snippet (password reset form):
    <form class="form-horizontal" method="POST" action="{{ route('password.request') }}">
        {{ csrf_field() }}
        <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
            <div class="col-md-12">
                <label for="email" class="control-label">E-Mail Address</label>
                <input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}" required autofocus>
                @if ($errors->has('email'))
                    <span class="help-block">
                        <strong>{{ $errors->first('email') }}</strong>
                    </span>
                @endif
            </div>
        </div>
    

I've gone through all the common fixes but still can't pinpoint the issue. Any ideas on what I might be missing here?

内容的提问来源于stack exchange,提问作者danyal14

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:56:38