When accessing a page, the program can only get some cookies

Source: Internet
Author: User

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.

  • 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.