Wednesday, March 7, 2012

MediaWiki Login Error

I tried to login to my mediawiki site and the following error is displayed:

"Login error - There seems to be a problem with your login session; this action has been canceled as a precaution against session hijacking.  Go back to the previous page, reload that page and then try again."





For the life of me, I do not remember exactly what I've done to my system which caused this error.  Maybe I did change the user or group of my mediawiki directory (recursively).

Solution:

Change to the location of your wiki directory, e.g.:
# cd /var/www/html/wiki


Modify LocalSettings.php:
# vi LocalSettings.php


Add as the last line to the config file before "?>":
session_save_path("tmp");


Save the file.


Create a 'tmp' directory on the root of your wiki directory:
# mkdir tmp


Change directory permissions
# chmod 777 tmp


This should prevent the login error from showing up, at least in my case.