CWebView::ClearCookies Method  
 
BOOL ClearCookies(
  BOOL bAllCookies  
);

The ClearCookies method deletes cookies for the current profile or session.

Parameters

bAllCookies
An optional boolean value which specifies if all cookies for the current user profile should be deleted, or only those cookies created during the current session. If this parameter is a non-zero value then all cookies stored in the current user's profile will be deleted.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

This method deletes cookies that have been created by the current WebView profile. If the bAllCookies parameter is set to TRUE, all stored cookies for every site are removed; if set to FALSE, only the cookies associated with the current session are cleared. The effect is comparable to clearing cookies in a regular browser: login sessions, preferences, and other state information stored in cookies will no longer be available. This only affects the WebView's private user data folder and does not modify cookies stored by the user's standalone Edge browser.

If you have used the WebView browser to authenticate with one or more websites, calling this method will typically log you out of those sites and require you to re-authenticate. If you have created the browser instance using a temporary data folder, or you have specified the WEBVIEW_OPTION_ENABLE_PRIVACY option, no cookies will be preserved after the session ends.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cshtmv12.lib

See Also