Access PHP session variables for authentication in MediaWiki

Viewed 79

I've got a private site that has its own login system built on PHP / MySQL. When users authenticate there, a set of session variables are written that confirm that the user is logged in. All subsequent pages they access check for these session variables before they can view those pages.

I've setup a MediaWiki also on the site that I'm testing at the moment. The contents cannot be publicly viewable, so I'd love to check for those same session variables on the MediaWiki to allow them access... but am having trouble figuring out the best way to do so. (Note: I'm very new to MediaWiki).

As soon as I add a session_start(); to the MediaWiki index.php, I get a Fatal Exception.

I've looked into using SessionManager and this code seems promising, but I'm unsure where to put it! Newbie question, I know. Can anyone let me know where to put this kind of code, or redirect me to a better way of handling this?

1 Answers

A session manager extension seems like it would be the way. You would have to make an extension that uses SessionProviders to register your session provider.

Related