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
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
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