这个函数就是创建Cookie。 看MSDN: This function creates a cookie associated with the specified URL..... Cookies created by this function without an expiration date are stored in memory and are available only in the same process that created them. Cookies that include an expiration date are stored in the windows\cookies directory.Creating a new cookie might cause a dialog box to appear on the screen if the appropriate registry value, AllowCookies, is set. There is no way to change the registry value from a WinInet function in Windows CE. 如果指定失效时间的话,他就会在windows\cookies文件夹内创建一个Cookie,如果不指定的话就仅限于当前进程
InternetSetCookie函数示例:
InternetSetCookie(url,NULL,L"CookieTest=ValTest;path=path value;expires=Thu, 01-Jan-1970 00:00:01 GMT");
使用InternetSetCookie删除cookie ms没有官方文档。经过无数次的测试之后发现:
1。 删除时一定要传入path参数,而且此参数必须和set是一致.
2。 setcookie是不带path参数则是对当前path起作用(如果url是一个文件的话,MS有问题)
3。 不同path值,即使cookie的名字一样也是两个不同的cookie。所以path很重要啊!
转载:http://blog.csdn.net/wewaa/article/details/6347245
看MSDN:
This function creates a cookie associated with the specified URL.....
Cookies created by this function without an expiration date are stored in memory and are available only in the same process that created them. Cookies that include an expiration date are stored in the windows\cookies directory.Creating a new cookie might cause a dialog box to appear on the screen if the appropriate registry value, AllowCookies, is set. There is no way to change the registry value from a WinInet function in Windows CE.
如果指定失效时间的话,他就会在windows\cookies文件夹内创建一个Cookie,如果不指定的话就仅限于当前进程