How cookies are sent to the website

After entering the username and password on the website, the cookie is stored on your computer. Your computer then sends the information from this cookie to the website whenever you view another page on this website so that the website knows who you are.

How is cookie information sent? Does the browser include cookie information in the html address?

+3
source share
1 answer

The browser sends an HTTP request (http://www.w3.org/Protocols/rfc2616/rfc2616.html) , which includes the URL, the request method (GET, POST, etc.), cookies, and a whole bunch of other things . Here is the request from my browser to this SO page:

GET /questions/2575970/how-are-cookies-sent-to-a-website HTTP/1.1
Host: stackoverflow.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: __utma=140021253.1463780230058740000.12348924611.1279210754.1270438283.1398; __utmz=140222553.12686423964.1149.21...
If-Modified-Since: Sun, 04 Apr 2010 21:30:58 GMT

, cookie , , .

+3

Source: https://habr.com/ru/post/1739786/


All Articles