durusmail: quixote-users: Setting cookies while redirecting
wierd TypeError caused by http_request.get_header
2004-08-28
2004-08-28
2004-08-30
2004-08-30
2004-08-30
Setting cookies while redirecting
2004-08-31
2004-08-31
2004-08-31
2004-08-31
2004-08-31
2004-08-31
2004-09-01
2004-09-03
2004-09-06
2004-09-06
2004-09-06
2004-08-31
Setting cookies while redirecting
alanp
2004-08-31
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This question is a little premature as i haven't delved into the
quixote code yet but thought i'd ask anyway :-)

i want to set a cookie and redirect the client in the same response.
The code is something along the lines of
def method [html] (request):
    # A bunch of other operations unrelated to the cookie or redirect....
    request.response.set_cookie("chocchip", "123")
    return request.redirect(....)

The browser is duly redirected but the cookie isn't set. If i replace
the "return request.redirect(...)" with a simple page, the cookie is
set.

A quick glance through http_request.py & http_response.py seems to tell
me that cookies are included in the headers sent during a redirect (i
think).

Any hints on what i'm doing wrong (before i start plowing through the
code and HTTP RFC)?

Thanks
alan


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFBNCObKJDmEytdZIcRAkBLAJ48l6nnRqFXYdpqLzkA9JrdBpKCSgCePv1r
Ha4s07/8mJuf5SI6EtA8d5M=
=33zO
-----END PGP SIGNATURE-----


reply