Python Forum
Extract Httponly, Secure, domain and path from a cookie - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Extract Httponly, Secure, domain and path from a cookie (/thread-23991.html)



Extract Httponly, Secure, domain and path from a cookie - randeniyamohan - Jan-26-2020

I am trying to extract the Httponly, Secure, domain and path from the given cookie in python. How do I do that in python ???

Code:
target_url = "https://www.google.com/"
response2 = requests.get(target_url).headers['Set-Cookie']
print(response2)
Result:
Output:
1P_JAR=2020-01-26-16; expires=Tue, 25-Feb-2020 16:51:26 GMT; path=/; domain=.google.com; Secure, NID=196=EXN1Mahz2_DymAp2otc-1JaTFvOHMPZHUWg9qPAA87OO4fx21wvl6D1aqY75vAjo1-4OcdAFJo1bqvpAR-IJ4m9c01KjXxF2UoH4A6Nacu3jwiY-DtUgwnNKtMfIS6wbCPhTexYlb43z6ostuA1K_S0eKjIlDqmkqRmMXUHwu3o; expires=Mon, 27-Jul-2020 16:51:26 GMT; path=/; domain=.google.com; HttpOnly