[mod_python] Cookies & mod_rewrite

Graham Dumpleton grahamd at dscpl.com.au
Tue Sep 19 16:56:39 EDT 2006

 From memory, you can set req.headers_in and it will go through to
backend via proxy. Give it a try anyway. Simply go:

   req.headers_in['X-MyHeader'] = 'test'

and see if it gets through.


On 19/09/2006, at 11:24 PM, CARTWRIGHT, Guy, GBM wrote:

>> Have you added logging in your authenhandler and know for sure  
>> that it is
> being called?
> Yep, it's definitely being called
>> I am not very good at mod_rewrite, but I read this as you using  
>> mod_rewrite
> to proxy the request
>> through to a backend server. If this is true and your expectation  
>> is that
> the cookie will be passed
>> through to the backend to be used there somehow before perhaps  
>> also being
> sent back to the client,
>> your assumption would be wrong. This is because setting a cookie  
>> in the
> authenhandler is going to be
>> done in the headers_out where only headers_in would be getting  
>> proxied
> through.
>> Is that what you were expecting?
> Yeah, that's what I was expecting or wanted to happen. Is there any  
> way of
> setting a cookie in the handler that can be read by the back-end  
> server?
> Maybe changing headers_in?
> Thanks & reagrds
> Guy
> ********************************************************************** 
> *************
> The Royal Bank of Scotland plc. Registered in Scotland No 90312.  
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
> Authorised and regulated by the Financial Services Authority
> This e-mail message is confidential and for use by the
> addressee only. If the message is received by anyone other
> than the addressee, please return the message to the sender
> by replying to it and then delete the message from your
> computer. Internet e-mails are not necessarily secure. The
> Royal Bank of Scotland plc does not accept responsibility for
> changes made to this message after it was sent.
> Whilst all reasonable care has been taken to avoid the
> transmission of viruses, it is the responsibility of the recipient to
> ensure that the onward transmission, opening or use of this
> message and any attachments will not adversely affect its
> systems or data. No responsibility is accepted by The
> Royal Bank of Scotland plc in this regard and the recipient should  
> carry
> out such virus and other checks as it considers appropriate.
> Visit our websites at:
> http://www.rbos.com
> http://www.rbsmarkets.com
> ********************************************************************** 
> *************

More information about the Mod_python mailing list