How to check if a user is logged on in mediawiki in a different app?
All you need to do is essentially forward the session, cookies and all, to the API as if it's the user querying.

How would one go about doing that? I can access the API directly and see my login info, but if I access it via PHP, it shows me as not being logged in (anonymous user id "0"). How do I forward the session, cookies, etc. to the API via PHP to show the user's info?
Here is the situation:
I have a Mediawiki installation, and a few additional server-side scripts that require more resources and were already written in a different language (python). The python code will be very loosely coupled with the Mediawiki code (only called by clicking on a link here or there)
What I would like is that when a GET or POST command is sent to the server to execute a python script, I would like to check to see if a user is already logged in to Mediawiki. If not, I would like to just redirect them to the Mediawiki login page.
Any ideas?
There are several articles on integrating Mediawiki with other PHP frameworks like Drupal and forum software, but that is more than I need.
What is the best way to do this?
-check for cookies somehow (is this secure?)
-does the Mediawiki database keep track of who is logged in?

Thanks