[mod_python] When using PSP is request object persistent?

PETER BARKER newbarker at btinternet.com
Sun Mar 11 04:21:57 EST 2007


Hello,
   
  See below for the stripped-down code to my problem/query. Note that I do not save the session anywhere.
   
  With the two PSP template lines commented, the session is always new (because I'm not saving it). When the templating code is uncommented, the session is remembered across requests. Why is this?
   
  APACHE CONFIG:
  <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/pypublish">
    SetHandler mod_python
    PythonDebug On
    PythonHandler mod_python.publisher
</Directory>

  INDEX.HTML:
  <html>
<head><title>hello</title></head>
<body>
</body>
</html>
   
  THETEST.PY:
  from mod_python import Session, psp
import os
  def entry(req):
  req.session = Session.Session(req)
  if req.session.is_new():
    returnedDoc = "Newly created session: " + req.session.id()
  else:
    returnedDoc = 'Existing session:' + req.session.id()
    #pathname = os.path.join(os.path.dirname(req.filename),'index.html')
  #psp.PSP(req,filename=pathname).run()
    req.content_type = 'text/html'
  return returnedDoc

  Regards,
   
  Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070311/db6eb7a9/attachment.html


More information about the Mod_python mailing list