Microsoft KB Archive/306354

= How to Use the InternetGetCookie Function to Retrieve Local Cookies =

Article ID: 306354

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft Internet Explorer 5.5 Service Pack 1
 * Microsoft Internet Explorer 5.5 Service Pack 2
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer 5.0

-



This article was previously published under Q306354



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.



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 &quot;local&quot;. 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 &quot;local&quot; reference, the function does not find the cookie because the folder does not physically exist on the local computer.



RESOLUTION
When you call the InternetGetCookie function to retrieve a cookie with the &quot;local&quot; 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 &quot;local/C:\test\testing&quot; the lpszUrlName parameter should be initialized to &quot;file:///C:\\test\\testing&quot; before calling the InternetGetCookie function.

Keywords: kbenv kbprb KB306354

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.