News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Using SMF sessions in python

Started by ahto, March 18, 2009, 06:33:59 AM

Previous topic - Next topic

ahto

Hi,

I would like to use smf's sessions in python so that people that are logged in smf are also logged in my python scripts.
In python I need to get the correct ID_MEMBER with sessions timeouts handled correctly.

Currently I fetch the session from db using cookie PHPSESSID's value, unserialize the data column and fetch the id from ban[ID_MEMBER].

But this really isn't as robust as i would need it to be.
For example when I logout from the forum, python doesn't see this change.

What is the process of doing this the right way?

Orstio

Use SMF's integration hooks, and call python code from them.

ahto

So there is now way to do this just inside of mysql?

青山 素子

If you use database-driven sessions in SMF, you could look at the sessions table and see if the user still has a valid session, I suppose.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Advertisement: