Apache Get Particular Cookie Value from Response in Httpd. Conf

I want to log a cookie value from response in Apache. How can I do that. The closest option is

Logformat "%{Set-Cookie}o"

this logs all cookies in response.

How can I extract a particular cookie value & log it?

1

2 Answers

Use the C format string to log a cookie, such as this:

Logformat "%{Foobar}C"

to log the contents of cookie Foobar.

References

1
Logformat "%{Foobar}C"

This works with request only. If there is a new cookie being set in the response, this will NOT pick that up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest