Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a mediawiki instance that seems to randomly log people out. Sometimes it takes hours, sometimes seconds. I haven't figured out what's triggering the logout, but it doesn't seem to be a session timeout. What php/mediawiki settings should I look at?

share|improve this question
What backend are you using to store PHP's sessions? This sounds like you are hitting a cache or memory limit, and the garbage collector is deleting stuff to make more room for new sessions. – devicenull May 31 '11 at 2:41
I don't know. It's a shared host, so I don't have control over apache or php settings. – Jayen Jun 3 '11 at 23:11
Do you have a publicly available memcached instance? There's no authentication whatsoever in memcached (by default) thus any script kiddie could telnet to yourhost:11211 and issue a flush. That would simply flush all caches which presumably also holds session data... – Server Horror Jun 16 '11 at 0:00
No memcached... – Jayen Jul 1 '11 at 23:38

Since Memcache is not an option, and I'm assuming that using tmp file storage is just as error prone in your shared hosting environment, your only route is to tell PHP to store the session data in MySQL (and once your server load can't accommodate this you'll then be able to move to hosting where you can use Memcache.) Two good articles on the topic for using MySQL to store PHP's sessions are and (though they are dated, they are still correct.)

share|improve this answer
what do you mean by tmp file storage? could i put the tmp file storage as a subdir of the the mediawiki instance? – Jayen Jul 21 '11 at 4:08
Assuming your save_handler is "files", you can use session_save_path to point to a directory that is in your control ( For that solution, you probably would want to set gc_probability to 0 and figure out your own garbage collection cron job. – Eric Caron Jul 21 '11 at 13:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.