Home mod_usertrack/mod_rewrite doesn't pass cookie to downstream apps on first request
Reply: 0

mod_usertrack/mod_rewrite doesn't pass cookie to downstream apps on first request

Harry Lime
1#
Harry Lime Published in 2017-12-07 17:49:21Z

I have apache configuration like

CookieTracking On

<Proxy balancer://my-cluster>
    BalancerMember http://my-server:8084 loadfactor=1 ping=10 ttl=300 timeout=120
</Proxy>
ProxyPass /mystuff balancer://my-cluster
ProxyPassReverse /mystuff balancer://my-cluster

But the cookie doesn't get passed to my-server on the first invocation. Subsequent invocations are fine. I'm guessing that this is because CookieTracking sets the cookie on the response, not the request.

Similar behaviour if I use mod_rewrite with mod_unique_id to ape what mod_usertrack does:

RewriteEngine On
RewriteCond %{HTTP_COOKIE} !^.*tracking_id.*$ [NC]
RewriteRule ^/ - [CO=tracking_id:%{ENV:UNIQUE_ID}:%{HTTP_HOST}:525600:/]

Is there anyway to add a cookie so that it will appear in the request cookies for downstream apps

Is it even possible to log the cookie that I've just created. This doesn't work (presumably again because C refers to request cookies)

LogFormat "%{tracking_id}C"
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.302372 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO