m615's avatar
Level 2

Why do I get a 419 | Page Expired when logging in to Nova on my staging enviroment?

I'm running Nova locally and it's turning out to be a great solution. I have an annoying issue that I can't seem to figure out.

When I ship to my staging environment and try to login I get a 419 | Page expired message however if I use a different browser than the one I'm using locally, login works just fine. I'm assuming this has something to do with sessions?

How can I make sure there isn't a conflict with session when running the same browser from local to staging?

0 likes
9 replies
jlrdw's avatar

Try clearing browser cache prior to testing (doing) the login.

m615's avatar
Level 2

I did and it didn’t seem to work.

jlrdw's avatar

What browser, in FF I hit ctrl-shift-del and choose everything, make sure cookies is also selected.

Perhaps after clearing, close browser and reopen.

jlrdw's avatar

I'd try with FF or Chrome. I'm not familiar with Brave.

m615's avatar
Level 2

Brave uses chromium

1 like
jlrdw's avatar

Does same happen if you login staging first, then local second. But if cache / cookies are cleared it should work correct. I suspect somehow a cookie isn't cleared.

behruz_ib's avatar

@m615 hi, My friend, were you able to solve this problem? I'm facing the same issue in production. Please share the solution with me

bvfi-dev's avatar

419 means one thing -> Somethings wrong with CSRF token. Here are pretty much most of the common steps to take in order to make sure that everything's fine:

  • Change session cookie name to be different for each environment in config/session.php (Through .env)
  • Mismatched or missing token means -> The session expired(which isnt the case here), the token wasn't included in the form, or the session storage isn't working properly. So next step would be to check the session storage. Memcached can be difficult to work with in Nova.
  • Make sure the SESSION_DOMAIN is set in .env (For the staging at least, local it should be null)
  • Read up on this CSRF article to get more familiar.

Please or to participate in this conversation.