[mod_python] MemorySession

Wagner,Harry wagnerh at oclc.org
Tue Feb 22 09:05:28 EST 2005


Should MemorySession work on Linux?  Session and DbmSession both work,
but MemorySession always returns 'true' to the 'if sess.is_new():'
statement (see code below).  The cookie (pysid) is written is just fine.
The doc says that MemorySession cannot be used in a 'multi-process
configuration'?  Does this mean it cannot be used on Linux?  

def handler(req):
	ddcServer = DDCServer(req)
#	sess = Session.Session(req)
#	sess =
Session.DbmSession(req,'/var/www/html2/mp_sess.dbm',None,None,gdbm,0,0)
	sess = Session.MemorySession(req)
	if sess.is_new():
		req.log_error("Session is new: " + str(sess.id()))
		sess['recs'] = 'whatever'
		sess.save()
		req.log_error("Session saved")
	elif not sess.is_new():
		req.log_error("Previous session loaded: "  +
str(sess.id()))
		sess.load()
		recs = sess['recs']
	ddcServer.do_GET()
	return apache.OK

Harry Wagner
http://www.oclc.org/research/staff/wagner.htm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050222/a44f189d/attachment-0001.html


More information about the Mod_python mailing list