Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

autefrum's avatar

Login Page - refresh token before post submit as login page has been open for ages

When a user logs in, a POST to /login includes _token data, and I understand why this is necessary.

We have implemented idle-time-logout after X minutes.

If a user is logged out by our application in a browser tab they are not using, and when they go to log back in, we have found a lot of TokenMismatchExceptions being thrown.

This is confusing as the user thinks it is a password issue, as they are unaware of the token.

When logging in, I don't think you should even need a token - it should be how you OBTAIN a token, not require you to already have one.

Is there a way to allow people to log in from a stale login page?

0 likes
2 replies
jlrdw's avatar
jlrdw
Best Answer
Level 75

Have another friendly page with a link to redirect to login page.

1 like
autefrum's avatar

Thanks jlrdw, that would be a simple solution

Please or to participate in this conversation.