[mod_python] cookies, sessions, persistent dbs?

John Mudd mudd at vex.net
Sat Mar 27 22:09:43 EST 2004

I'm able to create a session object, add data to it, save it (in dbm
file, I believe) and get it back for the next request.  Yeah!

I just want to see if I understand this much.

A cookie is just good for tagging a client so that it can be recognized
on the next request.  And it also allows data to persist between
requests.  The cookie data is saved on the client side.  Eventually it
expires and disappears.

Sessions also allow data to be saved between requests.  And, by using a
sessionId cookie, the data can be associated with a specific clients. 
Unlike cookies, sessions are stored on the server side and allow storing
larger amounts of data.  But, unlike cookies, the data may end up on
disk in a dbm file.

So, session objects are only needed when there's too much data to put it
all in cookies?

My session object is saved in a dbm file.  Are the sessions records
automatically deleted from the dbm file when the session expires?

Do I make a db connection persistent by simply saving the connection
variables, either in a cookie or a session object?

Thanks for any help.


More information about the Mod_python mailing list