Python Forum
Extract Httponly, Secure, domain and path from a cookie
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extract Httponly, Secure, domain and path from a cookie
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Best way to secure API key when sharing quarinteen 2 290 Jan-19-2024, 04:46 PM
Last Post: deanhystad
  How secure is the use of "secret" import? ejwjohn 12 1,154 Nov-09-2023, 08:31 AM
Last Post: ejwjohn
  Peaks in time domain frohr 0 451 Jul-06-2023, 02:57 AM
Last Post: frohr
  extract last word from path. mg24 4 1,679 Nov-01-2022, 10:55 AM
Last Post: carecavoador
  Requests Session Overwriting and cookie jar muzikman 0 1,267 Dec-13-2021, 02:22 PM
Last Post: muzikman
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,149 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  Cookie and Session JohnnyCoffee 6 3,044 Apr-14-2020, 02:04 PM
Last Post: JohnnyCoffee
  Secure App Data Storage for Kivy Android App JonPC 1 2,383 Nov-08-2019, 03:42 PM
Last Post: luke
  Save Cookie header value in var DavidFernandez 0 1,751 Aug-24-2018, 07:30 PM
Last Post: DavidFernandez
  .pth file does not show up in sys.path when configuring path. arjunsingh2908 2 5,670 Jul-03-2018, 11:16 AM
Last Post: arjunsingh2908

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020