Problem 1: A cookie is generated when a page is accessed. the cookie can only be obtained by the program, which is inconsistent with the cookie accessed by the browser. 2. the cookie in the response header has been obtained. To obtain the cookie in the request header. 3. test link: I .umeng.com supplement: backend service...
Problem
1. a cookie is generated when a page is accessed. the cookie can only be obtained by the program, which is inconsistent with the cookie accessed by the browser.
2. the cookie in the response header has been obtained.
To obtain the cookie in the request header.
3. test link: http:// I .umeng.com/
Supplement:
Backend service acquisition
Step 1: Clear browser cookies
Step 2: When you request this address for the first time, you find that the request header carries a cookie and you want to obtain the cookie.
No cookie settings are found in the response headers of other accesses. Therefore, I am curious about how the cookies in the request header come from.
To obtain the values of the following two names in the cookie
Cause: cookie generated by js
Reply content:
Problem
1. a cookie is generated when a page is accessed. the cookie can only be obtained by the program, which is inconsistent with the cookie accessed by the browser.
2. the cookie in the response header has been obtained.
To obtain the cookie in the request header.
3. test link: http:// I .umeng.com/
Supplement:
Backend service acquisition
Step 1: Clear browser cookies
Step 2: When you request this address for the first time, you find that the request header carries a cookie and you want to obtain the cookie.
No cookie settings are found in the response headers of other accesses. Therefore, I am curious about how the cookies in the request header come from.
To obtain the values of the following two names in the cookie
Cause: cookie generated by js
Do you want js to get the cookie or get the cookie in the backend service?
This is Umeng's logon, and I have read the cookies.
If you want the server to obtain the cookie contained in the request, check whether your web server address is in the same domain as the interface server address, if the request is not sent on the front-end page, you must manually set the cross-origin cookie.
Generally, if the web server and the interface server are the same domain name, the browser automatically receives all the cookies for each request sent to the interface server, the Interface Server uses the preset cookie-name to filter its own cookies.
I don't know if I can help you. can you clearly describe it? Or what do you want to do with this?
Understanding problems
In the same request, you want to set a cookie before obtaining the cookie you set? Of course, this is impossible.
The configured cookie can be obtained only in the next request.
Or,
When you set the cookie value in a request, you must know what the value is. you can directly use this value. why do you need to obtain the value through the cookie?
The cookie in the request header is set when you send the request ..