Skip to content

419 | Page Expired (CSRF token expired) #9981

@stephenmeehanuk

Description

@stephenmeehanuk

Bug description

When I try to login using Chrome, I see a 419 | Page Expired page. If I press back, I'm logged in?

  • Clear all cookies and cache in Google Chrome
  • Visit /cp/auth/login
  • Enter login details, press login
  • 419 | Page Expired
  • Press refresh, nothing
  • Press back, logged in?
  • Log out, returns to /cp/auth/login
  • Try to login again
  • 419 | Page Expired
  • Press back, /cp loads

On my staging site (https) I'm using STATAMIC_STATIC_CACHING_STRATEGY=half.
Someone in Discord suggested using SESSION_SECURE_COOKIE=true which I've done.

I've cleared the browser cache, and done a hard reload.

But it keeps on showing a 419 | Page Expired message.

It also happens on local (valet) http site. Not using SESSION_SECURE_COOKIE=truelocally.

How to reproduce

I think the issue is local to my browser, as it's not a problem when using incognito mode or Edge.

Just wondering why this would be happening?

Logs

No response

Environment

Environment
Application Name: 
Laravel Version: 10.48.10
PHP Version: 8.2.17
Composer Version: 2.7.4
Environment: staging
Debug Mode: OFF
URL: staging.lbfoster.com
Maintenance Mode: OFF

Cache
Config: CACHED
Events: NOT CACHED
Routes: CACHED
Views: CACHED

Drivers
Broadcasting: pusher
Cache: redis
Database: mysql
Logs: stack / single
Mail: smtp
Queue: redis
Session: redis

Livewire
Livewire: v3.4.11

Statamic
Addons: 6
Antlers: runtime
Sites: 1
Stache Watcher: Disabled
Static Caching: half
Version: 4.57.2 PRO

Statamic Addons
jacksleight/statamic-bard-mutator: 2.3.0
jonassiewertsen/statamic-jobs: 1.4.0
jonassiewertsen/statamic-live-search: 2.0.1
jonassiewertsen/statamic-livewire: 3.2.0
statamic/collaboration: 0.8.1
teamnovu/statamic-images-missing-alt: 1.0.2

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

Runtime (default)

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions