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?

Jayen
  • 1,857
  • 4
  • 16
  • 28
  • 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. – devicenull May 31 '11 at 02:41
  • I don't know. It's a shared host, so I don't have control over apache or php settings. – Jayen Jun 03 '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... – serverhorror Jun 16 '11 at 00:00
  • No memcached... – Jayen Jul 01 '11 at 23:38

1 Answers1

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.)

Eric Caron
  • 135
  • 3
  • 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 04:08
  • Assuming your save_handler is "files", you can use session_save_path to point to a directory that is in your control (http://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. – Eric Caron Jul 21 '11 at 13:53