[Twisted-Python] twisted.web.woven.guard.SessionWrapper problems

Clark C. Evans cce at clarkevans.com
Wed May 14 15:39:31 MDT 2003


On Mon, May 12, 2003 at 09:26:45AM +0200, Matthias Urlichs wrote:
| /sessionized-url/foo
| 	Set cookie
| 	Redirect to /sessionized-url/sp__aef9c34aecc3d9148/foo
| /sessionized-url/sp__aef9c34aecc3d9148/foo
| 	Redirect to either of the next two URLs depending on whether I see a
| 	cookie
| /sessionized-url/sp/foo
| 	URL to use with cookies
| /sessionized-url/sp_aef9c34aecc3d9148/foo
| 	URL to use without cookies

Just to comment.  The pathargs module in the standbox will help with
some of these things.   It uses a colon in the path item to signify
key/value pairs.

   /sessionized-url/session:aef9c34aecc3d9148/foo
  
The pathargs is generic so that *other* parameters can go there,
perhaps a client identifier, etc.

   /sessionized-url/client:29394/report:2939/session:aef9c34aecc3d9148/foo

The advantage of doing it this way, is that the person can copy/paste
the URL and send it to his friend.  Since in the background you
timeout session ids, and link it with a given ip address, you can 
present this person with a login-page, but yet keep the same
client/report identifier.    

Anyway, pathargs is very useful for maintaining state information
when you are using relative links without cookies.

Best,

Clark




More information about the Twisted-Python mailing list