phpmyadmin token mismatch for long time idle

For me this seemed to be caused by my root partition being full up, and I guess this error was triggered by php being unable to write to the session directory.


in file libraries/common.inc.php

line 1076
delete this part

 /*
 * There is no point in even attempting to process
 * an ajax request if there is a token mismatch
 */
 if (isset($response) && $response->isAjax() && $token_mismatch) {
    $response->isSuccess(false);
    $response->addJSON(
        'message',
        PMA_Message::error(__('Error: Token mismatch'))
    );
    exit;
}

I solve this annoying problem by following instructions below:

  1. open /etc/php5/apache2/php.ini
  2. find ;session.save_path = "/tmp", this line may look also like this ;session.save_path = "/var/lib/php5"
  3. remove first semicolon from this line
  4. restart apache by executing sudo service apache2 restart

FYI: I work under Ubuntu 12.04 with apache2, php5, phpMyAdmin 4.0.5 so for different systems and servers file path may be a little different.

In case of any troubles check if directory from step 2. is writable for server.

Good luck.