Group: Internet Functions (WinInet) - Library: wininet
BOOL InternetSetCookie (
LPCTSTR lpszUrl,
LPCTSTR lpszCookieName,
LPCTSTR lpszCookieData
); DECLARE INTEGER InternetSetCookie IN wininet;
STRING lpszUrl,;
STRING lpszCookieName,;
STRING lpszCookieData lpszUrl [in] Address of a null-terminated string that specifies the URL for which the cookie should be set.
lpszCookieName [in] Address of a string that contains the name to associate with the cookie data. If this parameter is NULL, no name is associated with the cookie.
lpszCookieData [in] Address of the actual data to associate with the URL.
Returns TRUE if successful, or FALSE otherwise.
See also: InternetGetCookie.
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.
See in attached examples how to create persistent and session cookies.
Home