req1 = urllib.request.Request(url1)
response = urllib.request.urlopen(req1)
cookie = response.headers.get('Set-Cookie')
req2 = urllib.request.Request(url2)
req2.add_header('cookie', cookie)
response = urllib.request.urlopen(req2)
Keeping a session in python while making HTTP requests