[mod_python] Save cookie and redirect

Gregory (Grisha) Trubetskoy grisha at modpython.org
Thu Jul 3 10:58:33 EST 2003


Could it be that the location that you're redirecting to isn't valid for
this cookie? IIRC, the default path attribute is the full path, i.e. if
cookie was issued in /my/location1/blah and you're redirecting to
/my/location2/blah, the browser won't send the cookie (unless you
explicitely specify path=/my)

Grisha

On Thu, 3 Jul 2003, Manfred Stienstra wrote:

> On Thursday 03 July 2003 13:39, Alexiev Nikolay wrote:
> > I try to set cookie and redirect with one response. Redirect works fine but
> > cookie dosn't exist. What can I do?
> >
> >
> > HTTP_MOVED_PERMANENTLY = 301
> > req.headers_out.add('Set-Cookie', cookies.output(header='',
> > sep='\r\nSet-Cookie:'))
> > req.headers_out.add('Location', redirect)
> > req.status = HTTP_MOVED_PERMANENTLY
>
> First set the cookie and after that redirect. If it's a login page you could
> display a page saying something like 'successfully logged in' (setting the
> cookie) and after that (5 secs or something) you redirect.
>
> Manfred
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list