[Twisted-Python] Woven and sessions

Edmund Dengler edmundd at eSentire.com
Fri Aug 8 10:29:27 EDT 2003

On Fri, 8 Aug 2003, Glyph Lefkowitz wrote:

> On Friday, August 8, 2003, at 12:19 AM, Edmund Dengler wrote:
> > Question 1: Can I suppress the "__session_just_started=1"?
> Not at the moment.  It used to be off, but some browsers balked at the
> redirect cycle.

I would question this. I have used a few systems that used redirects to
perform logins (via Apache, Resin) and I have yet to find a browser in
which this was an issue. Do you know specifically which ones?

> > 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 also noted a page talking about sandbox and pathargs, and : separated
> > arguments. Is this available, or should I look at creating a custom
> > resource?
> This is available in sandbox/cce/pathargs.py .
> > What I am looking to do at the end is support sessioning whether or not
> > cookies are being allowed, and to allow URLs to be taken.
> "allow URLs to be taken"?  Say again?

Sorry, "allow URLs to be bookmarked". I am trying to ensure that if a
person bookmarks a URL, that the next time they come in, they are
sessioned properly and that they will be logged in properly.

> > Question 3: I assume that all of this works similarly for perspective
> > wrappers? I was trying one Guard example I found on the net, and I am
> > having trouble actually causing the login page to appear (basically, I
> > am
> > using the "perspective-init" in the URL, and I seem to get some other
> > web
> > page with three input fields, rather than the supposedly specified
> > login
> > page).
> PerspectiveWrapper is old, dying code.  Use the (badly-named)
> UsernamePasswordWrapper.  An example is in sandbox/glyph/dynademo/ .
> > Aside Question: Is there a way to setup default error pages? I checked
> > the
> > How To's and looked in the archives for a simple example, and couldn't
> > find any.
> No, but this is in the bugtracker:
> http://www.twistedmatrix.com/users/roundup.twistd/twisted/issue135
> Some patches are available.

The above seems to be a problem related to a "if I cannot find the next
piece here through getChild, what do I do now?". Is there a possibility
of a model such as, "cannot do this, call my parent object in some manner
and tell it to deal with the issue"? Basically, a model with some
form of exception ("I did not return a fragment, but rather an issue") or
a callback ("yeah, you wanted me to do something, and I can't, so you deal
with it")?

In this way, the root object could have a "if a page cannot be found for
any reason, then do the following", and this could be overridden at each
level if desired.

Not sure if this follows the Twisted way of things.

> Sorry for the dearth of documentation here.  The folks responsible for
> these bits of code have been very busy lately :)

No probs. I understand extreme development. I figure with a mixture of
hacking snippets up to experiment, and hopefully answers to some of my
not-so-brilliant questions, that I can muddle through this evaluation.


More information about the Twisted-Python mailing list