Where are the cookies?

Good day

When the browser look at the headers and find the server responses SetCookie that you don't know where to go
In a database, browser cookie, I do not find, approx.
Set-Cookie: remember_user_token=blablabla blabla--; domain=.site.com; path=/;expires=Fri, 10-Feb-2017 10:04:58 GMT; HttpOnly


and the second line is also the set of cookies:

Set-Cookie: _site_session=blablabla blabla--; domain=site.com; path=/; HttpOnly


The table cook it this site has a cookie called "__utma", "__utmz", "__utmb" and only there they are. I explained that it was tracking cookies

As these cook I do not find: "remember_user_token" and "_site_session"

When you pull out a cookie with a session, I get only "remember_user_token"

and why, when I declare session, it is impossible to pass Headers?

import requests
from bs4 import BeautifulSoup

url = "http://site.com"

heads = {'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0)Gecko/20100101 Firefox/51.0', 'Host':'site.com'}

s = requests.Session()

response = s.get(url, headers =heads)
print(response.headers.values)

#{'User-Agent': 'python-requests/2.12.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}


But as they passed, for some reason I don't know:

s = requests.Session()
s.headers = heads

response = s.get(url, headers = s.headers)
print(response.headers.values)

#{'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0)Gecko/20100101 Firefox/51.0', 'Host': 'site.com'}
August 19th 19 at 23:20
2 answers
August 19th 19 at 23:22
Because here it is:
response = s.requests.get(url, headers =heads)

should be:
response = s.get(url, headers =heads)
Yes, I wrote the code wrong. the question is relevant - Melvina.Denes commented on August 19th 19 at 23:25
response.headers - the headers of the response. Your headers look a sniffer of Wireshark type - athena_Kemmer20 commented on August 19th 19 at 23:28
: I have my headers look plugin for Mazilu - Melvina.Denes commented on August 19th 19 at 23:31
: how Mozilla sees that you are sending to the server? - athena_Kemmer20 commented on August 19th 19 at 23:34
: using the plugin "View HTTP headers". since the beginning is that I send and then the server's response - Melvina.Denes commented on August 19th 19 at 23:37
Well, in General here - this absolutely works:

sessions = [requests.Session() for _ in range(3)]

headers = [{"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "EN-us,EN;q=0.8,en-US;q=0.5,en;q=0.3",
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:49.0) Gecko/20100101 Firefox/49.0"},
{"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,EN;q=0.8,en-GB;q=0.5,en;q=0.3",
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"},
{"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,EN;q=0.8,zh-CN;q=0.5,en;q=0.3",
"User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"}]

req = sessions[rnd_num].get(STARTING_PAGE, headers=headers[rnd_num]) - athena_Kemmer20 commented on August 19th 19 at 23:40
: thanks for example, now try
and about httpOnly cookies are not heard? now I read that the computer to find them is impossible, and without them, as I understand it, authorization is not possible at the site where I want - Melvina.Denes commented on August 19th 19 at 23:43
: request.Session cookies works fine. There remained, it is possible to look into s.cookies.get_dict()
You can try Selenium, all in the browser. Here in this book something that is dmkpress.com/catalog/computer/programming/python/9... - athena_Kemmer20 commented on August 19th 19 at 23:46
: a specific example can help? to deal in debt will not stay - Melvina.Denes commented on August 19th 19 at 23:49
: my mail in the profile is indicated - athena_Kemmer20 commented on August 19th 19 at 23:52
August 19th 19 at 23:24
heads = {'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0)Gecko/20100101 Firefox/51.0', 'Host':'site.com'}

s = requests.Session()

response = s.get(url, headers =heads)
print(response.headers.values)

the response object contains information about the response to your request (cookies, headers, body, etc.)
so you output the headers send by the server to which you sent the request.
To view the headers that are sent to you, use the headers attribute of the Session object()
You manage to get authorized on the website with requests? If Yes, then all the received cookies can be accessed through the attribute cookies to the same Session object()

Find more questions by tags Computer networksPython