[Twisted-web] web2 response.setCookie and request.getCookie shortcuts?

glyph at divmod.com glyph at divmod.com
Thu Nov 17 04:49:16 MST 2005

On Wed, 16 Nov 2005 17:42:34 -0500, "Clark C. Evans" <cce at clarkevans.com> wrote:
>I'm still having fun with web2, it is such a huge improvment over
>twisted.web and I'm absolutely thrilled with it.  However, I have
>a few suggestions:

>   1. It would be supreme if render() and locateChild() just provided
>      me the Request object; the incantation to ctx.locate() seems a
>      tedious an unnecessary step.

>   2. I would love a request.getCookie('cookie-name') and
>      response.setCookie('cookie-name','cookie-value', path = '/')
>      helper; that adds the given cookie to the current list.

>   3. Make the 'path' in the Cookie constructor and setCookie default
>      to '/'.  Almost all of the time you want your cookies to be
>      site-wide; adding path = '/' to each request adds a point of
>      failure that makes the system less usable.

Agreed on all points.  Especially that first one. ;)

More information about the Twisted-web mailing list