Reputation: 51
I'm the only person working on my dev machine (home computer), which has a Ubuntu operating system. I am not concerned with security that would be essential on a production server. I hate the token mismatch error that appears if I leave phpmyadmin sitting for too long. So I hacked libraries/common.inc.php on lines 483 through 486 to force phpmyadmin to always think that the token matched.
$token_mismatch = false;
/*if (PMA_isValid($_REQUEST['token'])) {
$token_mismatch = ($_SESSION[' PMA_token '] != $_REQUEST['token']);
}*/
Is this the best way to take care of this issue, and will this potentially screw something else up?
Upvotes: 5
Views: 2332
Reputation: 1178
In new version only just change true
to false
in the libraries/common.inc.php
. But not recommended in the production servers.
$token_mismatch = false;
Upvotes: 0
Reputation: 749
Disable token:
libraries/common.inc.php
/*
$token_mismatch = true;
if (PMA_isValid($_REQUEST['token'])) {
$token_mismatch = ($_SESSION[' PMA_token '] != $_REQUEST['token']);
}
*/
$token_mismatch = false;
Upvotes: 2
Reputation: 12462
That should be okay, but you can also increase the value of $cfg\['LoginCookieValidity'\]
in config.inc.php
. Note that you will also have to increase the PHP setting session.gc_maxlifetime
to match as the PHP setting overrides the phpMyAdmin one if it's smaller. That will prevent your session from expiring.
About the mismatched token portion of the problem, that's probably directly related to the expiring session but isn't the intended result (you are supposed to get a dialog notice that your session has expired and redirected to the login screen). The main cause of this that I've seen is answered here and is generally because PHP has a misconfigured session.save_path
directory (either it's commented out, doesn't exist, or has incorrect permissions).
Failing that, there was some work done recently to improve when the token mismatch error happens, but that does not seem to be directly related to the problem you're seeing. However, you could download the current "master" snapshot (https://github.com/phpmyadmin/phpmyadmin/ and look for the "Download ZIP" link on the right), or I suggest you check out release 4.3 once it's available, which should be rather soon.
Upvotes: 0