Python how to get cookie domain

I want to get a cookie domain from an HTTP response. The code:

cookie = Cookie.SimpleCookie() 
cookie.load(cookie_string) 
print 'cookie = ', cookie 

this shows the cookie as

cookie = Set-Cookie: Cycle = MA == | MA == | MA ==; Domain = .abc.xyz.net; expires = Tue, 05-Oct-2021 04:15:18 GMT; Path = /

I want to extract the domain from the above result.

I'm trying to

print cookie['Domain']
print cookie['Domain'].value
print cookie['Cycle']['Domain'].value

None of these works.

thank

+5
source share
1 answer

to try:

cookie['Cycle']['domain']    # lowercase domain !
+2
source

All Articles