![]() If it is blocked, URLRequestHttpJob likewise moves on to the next Set-Cookie header. The NetworkDelegate also gets a chance to block the setting of the cookie, based on the user's third-party cookie blocking settings. If a valid CanonicalCookie could not be created (due to some illegal syntax, inconsistent attribute values, or other circumstances preventing parsing), then we stop here, and URLRequestHttpJob moves on to the next Set-Cookie header. Once a CanonicalCookie is created, you will almost never see a ParsedCookie used for anything else. A CanonicalCookie has some additional guarantees of validity over a ParsedCookie, such as valid expiration times, valid domain and path attributes, etc. ![]() Any cookie consumer that does not deal directly with HTTP headers operates on CanonicalCookies. This is the main data type representing cookies. The ParsedCookie is then converted into a CanonicalCookie. The first token-value pair is always treated as the cookie's name and value. This struct simply records all the token-value pairs present in the Set-Cookie header and keeps track of which cookie attribute each corresponds to. (See Life of a URLRequest for more details.) The URLRequestHttpJob then reads any Set-Cookie headers in the response (there may be multiple) and processes each Set-Cookie header by calling into //net/cookies classes for parsing and storing:įirst, the cookie, which has been provided as a string, is parsed into a ParsedCookie. The response passes through the HttpNetworkTransaction and HttpCache::Transaction to the URLRequestHttpJob. Set-Cookie: chocolate_chip=tasty Secure SameSite=Lax Max-Age=3600 The header contents are parsed into a CanonicalCookie and passed to the CookieStore for storage.Ī cookie starts as a Set-Cookie header sent in the server's response to an HTTP request: HTTP/1.1 200 OK.The Set-Cookie header is processed by URLRequestHttpJob.An HTTP response containing a Set-Cookie header is received. ![]()
0 Comments
Leave a Reply. |