[Twisted-Python] Sessions and URLs

Edmund Dengler edmundd at eSentire.com
Sat Aug 9 23:44:12 EDT 2003


If there is no pattern match such as "session-name:XXXXX", then how will
you know if an entry is a cookie or a named child? For example, is "yyy" a
cookie or a child? Now, if the code was changed to check for children
first (to see if they exist or not), then you could possibly do this, bit
that would mean old links pointing to a no longer existent child would be
considered a cookie.

Or am I misunderstanding this (which is quite possible)?


On Sat, 9 Aug 2003, Glyph Lefkowitz wrote:

> On Saturday, August 9, 2003, at 11:45 AM, Edmund Dengler wrote:
> > So, the code is structured such that a cookie is not available, the
> > normal
> > children still get returned. Is this suppose to be how it works? Should
> > this be changed so that a flag is available for "force session"? Or
> > should
> > a session always be forced (no option)?
> Sorry, this should be documented.  You correctly figured out the series
> of steps (more or less) but you missed the annotation of the request
> :-).
> SessionWrapper mangles the request, slightly changing the semantics of
> getSession, so that it may return None.
> UsernamePasswordWrapper.getChild begins with
>          s = request.getSession()
>          if s is None:
>              return request.setupSession()
> since it currently requires a session in order to operate.  Eventually
> I hope to remove this and have it operate without a session when
> possible.
> > Should we have a pattern such as "session-name:cookie" so we can do a
> > pattern match for old sessions no longer cached (and force a new
> > session)?
> "pattern match"?  No, we just use a dictionary lookup.  SessionWrapper
> will already create a new session when the old one is no longer cached.
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

More information about the Twisted-Python mailing list