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

madala's avatar

Token MisMatchException

hi, i have maintaining three application in same server and for all three applications i use same users table when i login and logout in all three applications it says Token Mismatch Exception. can any one help me how to overcome this issue.

thanks

0 likes
2 replies
somnathsah's avatar

It happens when csrf token gets invalidated. If your login page remain inactive for some period of time then the token gets expired.

After refreshing your login page this issue will get resolved.

But for the permanent solution replace your login div after some interval of time with page refresh link.

Below is the example code

function hideForm () {
         $('#login_form').hide();
         $('#login_refresh').show();
     }
     
     $(document).ready(function () {
         window.setTimeout("hideForm()", 120000);
     });

Here 'login_form' is id of your login div and 'login_refresh' is id of your anchor tag with page refresh url

Above example code is for JQuery.

Snapey's avatar

all three applications are in different folders with their own session storage?

do they have different domains or subdomains?

Please or to participate in this conversation.