[mod_python] MySQL Session implementation?

Sébastien Arnaud arnaudsj at emedialibrary.org
Tue Jun 20 15:04:38 EDT 2006

Thanks Jim, it looks like SQLiteSession is a good start for what I  
want to do.

If I am successful I will share with everybody whatever I come up with.



On Jun 19, 2006, at 4:49 PM, Jim Gallacher wrote:

> Sébastien Arnaud wrote:
>> Hello to all,
>> I was wondering if anybody had worked on a clean integration of  
>> MySQL for session storage in opposition to the default local db  
>> file mp_session that gets written in /tmp
>> I have wrote a nice little web based app last year using  
>> mod_python and now the traffic is so that it is in a load  
>> balancing configuration, but the LB does not seem to work very  
>> well and "stick" a specific client to a specific server, which is  
>> causing users to get logged out of the app.
>> Anyway, before I decided to start to reinvent the wheel here, I  
>> thought I would ask, since it seemed to me like the easiest way to  
>> share the sessions across multiple webapp servers would be to  
>> extend the mod_python Session class to use a DB connection such as  
>> MySQL.
> Nicolas wrote an experimental SQLite backend which would likely be  
> a good starting point for you. Take a look at:
> http://svn.apache.org/viewvc/httpd/mod_python/branches/nlehuen/ 
> sandbox/SQLiteSession.py
>> Also, is there a way to rename the python session cookie as of 3.2.8?
> PythonOption session_cookie_name your-cookie-name
> This was added in 3.2.
> Jim

More information about the Mod_python mailing list