Problem
1, when accessing a page, generated a cookie, the program can only get the portion, and browser access to the cookie inconsistent.
2. The cookie in the response header has been obtained.
Want to get the cookie in the request header.
3. Test Link: http://i.umeng.com/
Add:
Back-end service acquisition
First step: Clean up browser cookies
The second step: when requesting the address for the first time, it is found that the request has a cookie associated with it and wants to obtain it.
In the response header of other accesses, no cookie settings were found, so it was curious how the cookie in the request header came from.
To get the value of the following two names in a cookie
Cause of problem: JS generated cookie
Reply content:
Problem
1, when accessing a page, generated a cookie, the program can only get the portion, and browser access to the cookie inconsistent.
2. The cookie in the response header has been obtained.
Want to get the cookie in the request header.
3. Test Link: http://i.umeng.com/
Add:
Back-end service acquisition
First step: Clean up browser cookies
The second step: when requesting the address for the first time, it is found that the request has a cookie associated with it and wants to obtain it.
In the response header of other accesses, no cookie settings were found, so it was curious how the cookie in the request header came from.
To get the value of the following two names in a cookie
Cause of problem: JS generated cookie
Do you want JS to get a cookie or a cookie that gets the request with the backend service?
This is the login of Friends League, I read the next cookie is normal.
If you want the server to get the cookie with the request, check that your Web server address is in a domain with the interface servers address, if it is not the front-end page to send the request is to manually set the cookie cross-domain.
Usually if the Web server and the interface server is the same domain name, each time the request to the interface server, the browser will automatically bring all the cookies under the domain name, the interface server through the pre-set Cookie-name to filter their own cookies.
Do not know if there is help you, you can in the description clear point? or what do you want to use this for?
Understand a problem
Do you want to set a cookie in the same request and then get the cookie you set? This is of course not possible.
The cookie set is to be obtained on the next request.
Or so to speak,
You set the cookie value first in a request, then you know what the value is, and you can use it directly, why do you get it through a cookie?
The cookie for the request header is set when you make the request.