[Zope-dev] __before_publishing_traverse__ calls RESPONSE.redirect(): is there another way to change the browser URL?

Craeg K Strong cstrong@arielpartners.com
Fri, 27 Sep 2002 23:20:05 -0400


Indeed this should work.  Although I will first try out Casey's idea of using
the SessionDataManager, this is a nice fallback.  Very creative! :-)

--Craeg

Oliver Bleutgen wrote:
> Craeg K Strong wrote:
> 
>> I believe HTTP_REFERER will list the place from whence you were 
>> redirected,
>> but unfortunately it does not distinguish between
>>
>>  "redirect"  and
>>
>> "following HTML link"
>>
>> Of which my application has many :-(
> 
> 
> 
> Ok, then here are two other ideas:
> 
> 1. in your redirect to an acquired method which itself redirects back to 
> the document, this creates a HTTP_REFERER header which will tell you 
> that it - via this method - came from your application:
> 
> raise 'Redirect',newURL+'/I_am_just_here_to_show_the_special_redirect'
> 
> where 'I_am_just_here_to_show_the_special_redirect'
> 
> is a python script which just does
> context.REQUEST.RESPONSE.redirect(context.absolute_url())
> 
> I don't know ATM if you need perhaps context.aq_parent.absolute_url().
> 
> Now inspect HTTP_REFERER.split('/')[-1].
> 
> But note that HTTP_REFERER is not secure, because it's sent by the 
> client, and some privacy tools/proxies might suppress it.
> 
> 2. use cookies, which have their own problems.
> 
> Or, use both methods.
> 
> cheers,
> olive