I am getting this error on export of my database in adminer. Error: Invalid CSRF token. Send the form again. If you did not send this request from Adminer then close this page. Need Help
11 Answers
Try this!
chgrp nginx /var/lib/php/session
The problem may cause by session save path not writable. I have faced the same problem and I fixed it by above command. I use nginx but if you use another web server, just change it. Hope this helps!

- 2,712
- 3
- 20
- 42
-
This did the trick for me. Seems that many answers here point into that direction. – andreaslangsays Dec 07 '18 at 07:51
The problem for me was that the session cookie had the secure
flag, while I was accessing adminer via http only (not https).
Our nginx configuration had
fastcgi_param HTTPS on;
which I had to remove.

- 30,033
- 14
- 133
- 194
Check that /var/lib/php/session
exists and that nginx
can write to it.

- 17,269
- 27
- 101
- 156
Your session should contain a CSRF token to prevent a CSRF attack. This message means that you either have no token stored or your token is not the same as that generated by your server. I assume that you don't have a writable path configured in your php.ini where you can store the session. Please check if you have set session.save_path in php.ini to a writable path.

- 322
- 2
- 15
Find session.save_path in phpinfo (/var/lib/php/session for Centos) and change the mode:
chmod -R 777 /var/lib/php/session
done!

- 5,564
- 3
- 36
- 37
What setup are you using? I had this happen with nginx + php-fpm, and after I did a diff of php.ini
of one machine where adminer worked and one where it didn't, and found out that I needed to blank out the value for session.cookie_domain
.

- 245
- 3
- 8
Sometimes it happens on previous PHP versions, which is not very important. You can refresh the page or reopen it, this will fix it.

- 5,271
- 9
- 40
- 61

- 261
- 2
- 13
It happened to me an hour ago. Check you have enough space in /var. I cleaned it and it works again.

- 158
- 1
- 3
- 9
https://sourceforge.net/p/adminer/bugs-and-features/174/#429b : Yes this problem is caused by session savepath not being writable, add this line to the top of your file, will work if your host allows it
ini_set( 'session.save_path', 'path/to/writable/directory/' );

- 546
- 6
- 18
Check if your filesystem is not full.
df - kh
It can be a explanation of not be able to write on it.

- 3,692
- 13
- 33
- 43

- 41
- 3