[Twisted-Python] Woven and sessions

Edmund Dengler edmundd at eSentire.com
Fri Aug 8 12:02:38 EDT 2003

Howdy all!

Here is the (striped) sample code I am using to play with the session
stuff. I am using the CVS tip from Aug 5.


from twisted.internet import reactor
from twisted.web import static, server

# imports needed for woven guard
from twisted.web.woven import guard

sessWrapped = static.Data("you should never see this", "text/plain")
swChild = static.Data("here is the stuff", "text/plain")
sessWrapped.putChild("yyy", swChild)
swrap = guard.SessionWrapper(sessWrapped)

da = static.Data("you should never see this ???", "text/plain")
da.putChild("xxx", swrap)

site = server.Site(da)
reactor.listenTCP(8080, site)


If I do http://localhost:8080/xxx/yyy, I get back the page with no session


On Fri, 8 Aug 2003, Christopher Armstrong wrote:

> > > > Question 2: Can I force a session cycle (ie, force /xxx/yyy to have a
> > > > session?
> > >
> > > It should happen automatically.  Isn't it?
> >
> > No it doesn't, which is an issue. I perform an /xxx/yyy, and I get the
> > page with no cookie set or placed in the URL.
> I don't understand this, it works for me. If there is a SessionWrapper
> at /, /xxx, or /xxx/yyy, then it should be working.

More information about the Twisted-Python mailing list