When using python I am unable to log the cookies associated with a request made to an application which adds a JSESSIONID to my request. Meanwhile accessing the same URL with curl or a browser does.
RHEL 7.6, Tomcat 8.5.51 server.xml includes
<Valve className="org.apache.catalina.valves.AccessLogValve" ... JSESSIONID:%{JSESSIONID}c... />
python
>>>import requests
>>>requests.__version__
'2.22.0'
>>>s = requests.Session()
>>>r = s.get(url, verify=False)
>>>for h in r.headers:
... print(h + ":" + r.headers[h])
yields "Set-Cookie:JSESSIONID=7FEC20ECDEA11AC01A14A9346E26B9C3; Path=/xyz; Secure; HttpOnly"
and
>>>for c in s.cookies:
... print(c)
yields "<Cookie JSESSIONID=7FEC20ECDEA11AC01A14A9346E26B9C3 for server/xyz>"
However, my access log always shows "JSESSIONID:-" following my request.
Any ideas?