Internetsetcookieex and internetgetcookieex use tip (cookie file format)

Source: Internet
Author: User

Note that the szcookiename parameter is not very good for both functions. It is best to set it to null and then manually write it in the content when writing cookies:

"My_cookie_name = my_cookie_value; Path =/; expires = wed, 30-Mar-11 09:00:00 GMT; domain = .csdn.net"

Read the entire data and parse it by yourself.

 

In addition, internetgetcookieex's dwflag parameter, for IE8, it is best to add internet_cookie_httponly to read the Cookie field value with the HTTPOnly attribute. If the SDK is old and does not have this macro, you can directly extract the two functions from the DLL getprocaddress and define this value as 0x00002000. For IE6 and IE7, If You Want To obtain HTTPOnly cookies, you have to manually read the cookie file and parse it.

 

Cookie file format:

 

_ Ntes_nnid // field name

456f74e9863f8f4b1a1e37774b0c464d, 0 // Field Value

163. com // The domain to which the field belongs

3584 // flag

3205176064 // expiration time (low)

37425091 // expiration time (high)

2444768976 // creation time (low level)

30082544 // creation time (high)

 

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.