简体   繁体   English

以编程方式读取Internet Explorer Cookie

[英]Programmatically read internet explorer cookies

I'm trying to create a piece of software (C++ with Qt) that would search some data into cookies of my website. 我正在尝试创建一个软件(带有Qt的C ++),该软件可以将一些数据搜索到我网站的cookie中。

I found the WinAPI function named InternetGetCookie(szURL, NULL, lpszData, &dwSize) but when I want to show the result I have something like this: 我找到了名为InternetGetCookie(szURL,NULL,lpszData,&dwSize)的WinAPI函数但是当我想显示结果时,我会看到以下内容:

__utma=166311972.1573129762.1302471948.1313050619.1313050781.24; __utmz=166
311972.1302471948.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); kk_als=ZmNk
YzE4MGIzYWQwMDI3Mzc0ZTkwMDQ2MWMwMGM5MTUjIzgxLjI0Ny4zNi4xNTcjI05PX1BBUkVOVCMjMTMw
MjQ3MTk1MiMjLyMjTk9fUkVGRVJFUiMjTk9fT1BUX0lORk8jIzEjIzAjIzAjIzAjIzAjIzEjIzE%3D

It looks like base64 but I can't find what I want. 看起来像base64,但是我找不到我想要的东西。

Somebody know how to read this cookie ? 有人知道如何读取此cookie吗?

PS: sorry for my bad english. PS:对不起,我的英语不好。

I found. 我发现。

When IE is in protected mode you can't see all the cookies with "InternetGetCookie" 当IE处于保护模式时,您无法通过“ InternetGetCookie”看到所有cookie

To solve this problem there is an other function: 为了解决这个问题,还有另一个功能:

    HRESULT IEGetProtectedModeCookie(
  __in     LPCWSTR lpszURL,
  __in     LPCWSTR lpszCookieName,
  __inout  LPWSTR pszCookieData,
  __inout  DWORD *pcchCookieData,
  __in     DWORD dwFlags
  );

InternetGetCookie return a string with all cookies for a given url separated by semicolons. InternetGetCookie返回一个字符串,其中包含给定URL的所有cookie,并用分号分隔。 Each cookie in the string is in the format name=data 字符串中的每个cookie的格式均为name = data

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM