InternetSetCookieEx (Windows CE 5.0)

Send Feedback

This function creates a cookie associated with the specified URL. This function extends the functionality of InternetSetCookie by identifying third-party cookies.

BOOL InternetSetCookieEx( LPCTSTRlpszUrl,LPCTSTRlpszCookieName,LPCTSTRlpszCookieData,DWORDdwFlags,DWORD_PTRdwReserved);

Parameters

  • lpszUrl
    [in] Pointer to a null-terminated string that specifies the URL for which the cookie should be set.
  • lpszCookieName
    [in] Pointer to 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] Pointer to the actual data to associate with the URL.
  • dwFlags
    [in] Must be set to INTERNET_COOKIE_THIRD_PARTY. In Windows CE, any other value will cause function to return FALSE with the error message set to ERROR_INVALID_PARAMETER.
  • dwReserved
    [in] Reserved. Must be set to zero.

Return Values

Returns TRUE if successful, or FALSE otherwise. To get a specific error message, call GetLastError.

Remarks

As with InternetSetCookie, InternetSetCookieEx creates a cookie that is associated with a particular URL. In addition, InternetSetCookieEx verifies that the cookie is a third-party cookie and checks the policy to see if third-party cookies are allowed.

Creating a new cookie may 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.

Persistent cookies, which have an expiration date, are stored in the location specified in the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders registry key. The default location is Windows\Profiles\Guest\Cookies. Session cookies, which do not have an expiration date, are stored in memory and are available only to the process in which they were created.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Wininet.h.
Link Library: Wininet.lib.

See Also

Cookies | WinInet Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.