apache反向代理session错乱问题

最近生产上碰到棘手的问题。通过apache反向代理tomcat,session会错乱丢失。
apache配置如下:

ProxyPass /webtest/ http://192.168.1.1/web/
ProxyPassReverse /webtest/ http://192.168.1.1/web/
ProxyPassReverseCookiePath /web /webtest

ProxyPass /webhaha/ http://192.168.1.1/webhaha/
ProxyPassReverse /webhaha/ http://192.168.1.1/webhaha/

出问题的就是webhaha应用。
原因是ProxyPassReverseCookiePath 中/web是会自动匹配所有/web*的链接,并把cookie代理到webtest上。导致session错乱。

解决方法,修改ProxyPassReverseCookiePath为
ProxyPassReverseCookiePath /web/ /webtest/
问题解决