Problem to Delete Cookies.

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Problem to Delete Cookies.

Postby ice2heart » Tue Oct 28, 2014 3:12 am

Hello.
I have some code on Qt+ cef. And I try delete all cookies on 1 site.
Code: Select all
CefString qs2cef(const QString &str)
{
   CefString result(str.toStdWString());
   return result;
}
void QCefWidget::clearCookies(const QString &url)
{
   CefPostTask(TID_IO, new ClearCookiesTask(url));
}
...
void ClearCookiesTask::Execute()
{
   CefRefPtr< CefCookieManager > m = CefCookieManager::GetGlobalManager();
   qDebug()<<__FUNCTION__<<mUrl<<m->DeleteCookies(qs2cef((mUrl)), CefString());
}

If I try call function clearCookies("http://www.html-kit.com/tools/cookietester/");
Function output
Code: Select all
ClearCookiesTask::Execute http://www.html-kit.com/tools/cookietester/ true

But cookies not delete, where is may be problem?
If i try call function in empty string, then delete all cookies.
P.s. sorry for my English.
ice2heart
Newbie
 
Posts: 2
Joined: Tue Oct 28, 2014 1:54 am

Re: Problem to Delete Cookies.

Postby magreenblatt » Tue Oct 28, 2014 8:23 am

If you go to the Resources tab in DevTools and expand the Cookies option in the left-hand menu you will see that html-kit.com does not specify a path component when setting the cookie. You therefore need to use the URL "http://www.html-kit.com/" (empty path component) when deleting the cookie.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Problem to Delete Cookies.

Postby ice2heart » Tue Oct 28, 2014 11:26 am

magreenblatt wrote:If you go to the Resources tab in DevTools and expand the Cookies option in the left-hand menu you will see that html-kit.com does not specify a path component when setting the cookie. You therefore need to use the URL "http://www.html-kit.com/" (empty path component) when deleting the cookie.

I try.
Code: Select all
//Function            Address               return_value
ClearCookiesTask::Execute "http://www.html-kit.com/" true
ClearCookiesTask::Execute "http://www.html-kit.com" true

But cookies are still here.
I used cef_binary_3.2062.1854_windows32.
Maybe I'm doing something wrong?
ice2heart
Newbie
 
Posts: 2
Joined: Tue Oct 28, 2014 1:54 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 81 guests