[mod_python] Is external redirect supposed to send acookie(mpservlets)?

Daniel Popowich dpopowich at comcast.net
Tue Jun 21 09:27:15 EDT 2005


Scott Chapman writes:
> Graham Dumpleton wrote:
> > Is the problem perhaps that you are using:
> > 
> >   self.external_redirect(...)
> > 
> > and not:
> > 
> >   util.redirect(...)
> > 
> > In util.redirect(), it writes actual page content out and this may
> > trigger the flushing out of any headers that have been set indirectly
> > by Session for cookies.
> > 
> > In self.external_redirect() of mpservlets() it neither flushes the
> > headers or writes any content and so cookie headers may not
> > get written.
> > 
> > Graham
> 
> That fixed it.  I was also popping the wrong value but popping the 
> correct one did not solve the problem.  Using util.redirect did.
> 

I have to confess, when I wrote mpservlets I completely missed
utils.redirect().  Duh.  Everywhere else I built on top of
mod_python, not wanting to reinvent the wheel.  Here's a lesson for
you!

Next version, external_redirect() will wrap utils.redirect().  I will
apply this fix to my next release of mpservlets.  Thanks to Scott and
Graham.

Cheers,

Daniel Popowich
-----------------------------------------------
http://home.comcast.net/~d.popowich/mpservlets/


More information about the Mod_python mailing list