Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to Use the InternetGetCookie() Function to Retrieve Local Cookies


View products that this article applies to.

This article was previously published under Q306354

↑ Back to the top


Symptoms

When you call the Win32 Wininet InternetGetCookie function to retrieve a cookie that was created from a locally run HTML page, the function does not retrieve the cookie that was requested.

↑ Back to the top


Cause

When it references the local HTML page, the temporary Internet files cache in Internet Explorer indicates that the path to the local HTML page is referenced as "~~local~~". This reference is simply a marker to indicate that that content exists in the My Computer security zone. If the InternetGetCookie function is called by passing in the "~~local~~" reference, the function does not find the cookie because the folder does not physically exist on the local computer.

↑ Back to the top


Resolution

When you call the InternetGetCookie function to retrieve a cookie with the "~~local~~" reference, the lpszUrlName parameter should contain the path by using the FILE:// method. For example, to retrieve a cookie that is referenced within the cache as "~~local~~/C:\test\testing" the lpszUrlName parameter should be initialized to "file:///C:\\test\\testing" before calling the InternetGetCookie function.

↑ Back to the top


Keywords: KB306354, kbprb, kbenv

↑ Back to the top

Article Info
Article ID : 306354
Revision : 4
Created on : 1/31/2007
Published on : 1/31/2007
Exists online : False
Views : 480