[ZendTo] Re: IIS7 reverse proxy (small bug and fix)

Jules Jules at Zend.To
Mon Apr 15 15:11:43 BST 2013


David,

Sorry for the long delay in replying, I've been in hospital for a bit 
(and have to go back in again in a couple of weeks).

Many thanks for that bug fix! I have added it to the main code base, and 
it will be in the next release.

Cheers,
Jules.

On 02/04/2013 11:36, David Turvey wrote:
> Hi,
>
> I came across a small bug while running zend.to behind a IIS7 reverse proxy. The user would be able to login successfully but the next click would return to a logged out state.
>
> I tracked this down to IIS7 adding a port number to the REMOTE_ADDR server variable. This is added to the cookie. The current cookie parsing in NSSDropBox.php-> userFromCookie() doesn't handle this case.
>
> Changing the preg_match call to the following seems to fix the issue. Note the new non-capturing group in the regex.
>      preg_match('/^(.+)\,([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(?:\:[0-9]+)?),([0-9]+),([0-9]+),([A-Fa-f0-9]+)$/',$cookieVal,$cookiePieces)
>
> I hope this workaround could be of benefit to others and possible get added into the main code base.
>
> Thanks
>
> --
> David Turvey
> IT
>
> BHC Ltd, Medwyn Park, Edinburgh Road,Carnwath, ML11 8HS
> 01555 840006
> www.bhc.ltd.uk
>
>
> _______________________________________________
> ZendTo mailing list
> ZendTo at zend.to
> http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto
>
> Jules
>
> -- 
> Julian Field MEng MBCS CITP CEng
>
> 'All programs have a desire to be useful' - Tron, 1982
>
> www.Zend.To
> Twitter: @JulesFM
> PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654


More information about the ZendTo mailing list