Home » Php » php – XAMPP error: Token mismatch

php – XAMPP error: Token mismatch

Posted by: admin July 12, 2020 Leave a comment

Questions:

I am using xampp on chrome in a mac and I can’t access phpMyAdmin. I used to get a error on the site, but I changed the session.save_path in the configuration file and it opened put now every time I try to press something it gives me an error saying Error: Token mismatch.

Here is the error I am getting:

Here’s a link of the same image: http://ninjas.zxq.net/error

Does anybody know why this is happening?

How to&Answers:

I found the answer.

Go to your php.ini file in Applications>XAMPP>xamppfiles>etc>php.ini

around line 1507 uncomment the line

;session.save_path = "/tmp"

by removing the semicolon. This worked for me right away.

Answer:

simply changing the tmp path wasn’t enough for me..
verify in your browser that you accept cookies and that adblock etc.. is disabled.

although having said that if you’ve managed to post to this site all that is probably under control 🙂

Answer:

  1. Find your php.ini (php -i|grep php.ini) if nginx edit /etc/php5/fpm/php.ini if fpm used.
  2. Uncomment ;session.save_path =”/tmp”
  3. Restart apache or if you use nginx – /etc/init.d/php5-fpm restart
  4. Check /tmp directory to make sure sessions are getting saved there. if you see something like “sess_h820h8ja6pl4bhdmqflngeui23” then your are done.

Answer:

I had the same issue, except none of the answers solved my problem. (Localhost with Xampp on Windows 10, using Chrome.)

After some time I figured out that you have to manually delete browser cookies etc to let it refresh/reset the token.

Answer:

My problem solution was something different again.

I had a user script that was active on the page. In my case it was a TamperMonkey script, but GreaseMonkey, ViolentMonkey, etc could do the same thing.

As soon as I disabled TamperMonkey, problem solved.

First I disabled TamperMonkey completely, using the Enable/Disable checkbox on the icon, to test the theory in general. Problem went away. So then I identified the specific script that was active on the phpMyAdmin page, and I was able to just disable that one script to solve the problem.

Note that the problem script did not in any way modify the phpMyAdmin page – I reduced it to a literally empty script that was loaded onto every webpage. However, just loading itself (an empty, do-nothing script) onto the phpMyAdmin page enough to cause the problem.