Jump to content

Invalid CSRF Protection Token


Go to solution Solved by SeanP,

Recommended Posts

This has plagued me!!!! looked everywhere I know, this happens in chrome, firefox works fine.

Please any new ideas, don't be shy.

 

I am trying to access my whmcs install from a iframe (it worked perfect before the last upgrade)
<iframe name="Portal" src="https://domain.com/index.php?rp=/login" height="1500" width="100%" ></iframe></p>

 

The login page loads the page as it should but it won't let any clients log in

This is what I have tried so far:

Clear cache and cookies, also did a dnsflush on my local computer
Changed PHP version, now using 7.4.28
Changed session path to: 
/var/cpanel/php/sessions/ea-php74 (chmod 777)

phpinfo       session.save_path /var/cpanel/php/sessions/ea-php74

Also changed: vi /usr/local/cpanel/3rdparty/php/74/etc/php.ini (to above path)
Disabled CSRF Checks in whmcs setting ( tried every combination with both toggles) (CSRF Tokens: General), (CSRF Tokens: Domain Checker)

Added all Ip's from my hosting server to my whmcs server in the "API IP Access Restriction" box

 

 

 

Thank You!

Link to comment
Share on other sites

  • WHMCS Technical Analyst
Quote

The login page loads the page as it should but it won't let any clients log in

Do you get any other error at all other than the CSRF error?
Please try using the browsers developer tools to see if there are any errors. It will show up in a highlighted red text in the console usually. You should also check the Network tab console too.

Now, If this is only happening in Google Chrome browser, you should be able to resolve this issue by disabling SameSite by default cookies flag in Google Chrome. To disable, type chrome://flags  in the address bar of your chrome browser and then disable the flag SameSite by default cookies.  (This has also been reported with the Edge browser)

Safari Browser - You have to untick Prevent cross-site tracking under Safari > Preferences > Privacy 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated