Python Forum

Full Version: Extract Httponly, Secure, domain and path from a cookie
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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