When accessing a page, the user can only obtain some cookies.

Source: Internet
Author: User
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 ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.