1

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?

4
  • 1
    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. Commented May 31, 2011 at 2:41
  • I don't know. It's a shared host, so I don't have control over apache or php settings. Commented Jun 3, 2011 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... Commented Jun 16, 2011 at 0:00
  • No memcached... Commented Jul 1, 2011 at 23:38

1 Answer 1

0

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 http://www.tonymarston.net/php-mysql/session-handler.html and http://shiflett.org/articles/storing-sessions-in-a-database (though they are dated, they are still correct.)

2
  • what do you mean by tmp file storage? could i put the tmp file storage as a subdir of the the mediawiki instance? Commented Jul 21, 2011 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 (php.net/manual/en/function.session-save-path.php). For that solution, you probably would want to set gc_probability to 0 and figure out your own garbage collection cron job. Commented Jul 21, 2011 at 13:53

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.