InternetSetCookie do not share Cookies

Source: Internet
Author: User

But MSDN tells us that the cookies that InternetSetCookie set are valid only within this process and cannot be accessed across processes. New IE, of course, belongs to the new process, so even if you call the InternetSetCookie set cookies, it cannot commit the cookie content to the server side.

From: http://www.cnblogs.com/michaellee/archive/2009/02/05/1383743.html//Know the above content can be good enough, and then plan.

InternetGetCookie This function does not explain, search it.

BOOL Breturn;

Create a session cookie. Read English;
Breturn = InternetSetCookie ("Http://www.qyjz.net", NULL, "TestData = Data");

Create a persistent cookie.//see English;
Breturn = InternetSetCookie ("Http://www.qyjz.net", NULL, "TestData = Data;expires = Sat, 31-dec-2007 14:00:00 G" MT ");

After countless attempts, I finally got a clue. These two brothers functions are a little special, I think it is wrong to publish online examples, but it may be different in the way various languages are used.

For Delphi 7, when you use the InternetSetCookie function to set up Cookeis, you append a string to the original cookie. See the blue string above, the preceding should not be preceded by a semicolon ";", otherwise invalid ("; TestData = Data;expires = Sat, 31-dec-2007 14:00:00 GMT ") This is wrong. A lot of code on the Internet is a semicolon, hehe,,,, and, on the network of these two functions of the code is wrong. If this function InternetSetCookie can be completely replaced instead of appending strings in the back, it is done correctly, but it seems impossible to do oh ~~~~~ or, I have not fully understood.

This is more information on the function of language, easy language to write this on the function I have followed ~ "" The same problem,

So internetsetcookie this function can only append strings to the original cookie.

The correct use of the method I already know, do not explain, the veteran flew over, rookie station contact me ... ^-^ ``

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.