void ResourceHandle::checkAndSendCookies(KURL& url)
{
    // Cookies are a part of the http protocol only
    if (!String(d->m_url).startsWith("http"))
        return;

    if (url.isEmpty())
        url = KURL(d->m_url);

    CookieManager* manager = CookieManager::getCookieManager();

    if (!manager)
        return;

    // Prepare a cookie header if there are cookies related to this url.
    String cookiePairs = manager->getCookie(url);

    // Cookie size should not be above 81920 (per construction and also because we
    // do not want to  cookie).
    ASSERT(cookiePairs.length() <= 81920);

    // We choose a max size of 81921 caracters because a cookie max size is 4096 and a domain can have at max 20 cookies so 20 * 4096 + 1 ('\0') = 81921
    static char cookieChar[81921];
    strncpy(cookieChar, cookiePairs.utf8().data(), 81920);

    // Force the string to be zero-terminated as required by libCURL.
    cookieChar[81920] = '\0';

    if (!cookiePairs.isEmpty() && d->m_handle) {
        LOG(Network, "CURL POST Cookie : %s \n", cookieChar);
        curl_easy_setopt(d->m_handle, CURLOPT_COOKIE, cookieChar);
    }
}
예제 #2
0
void MainMenu::showCookieManager()
{
    CookieManager* m = mApp->cookieManager();
    m->refreshTable();
    m->show();
    m->raise();
}
예제 #3
0
void Preferences::showCookieManager()
{
    CookieManager* m = mApp->cookieManager();
    m->refreshTable();

    m->show();
    m->raise();
}
void ResourceHandle::setCookies()
{
    CookieManager* manager = CookieManager::getCookieManager();
    KURL url = getInternal()->m_response.url();

    if (manager)
        manager->setCookies(url, KURL(), getInternal()->m_response.httpHeaderField("Set-Cookie"));

    checkAndSendCookies(url);
}
예제 #5
0
void HttpManager::SetCookie( std::string url, const std::string& cookie_data )
{
	CookieManager::Cookies* p = cookies_manager_.GetCookies(url, true);
	if(p)
		p->SetString(NULL, cookie_data);
}
예제 #6
0
void HttpManager::GetCookies( std::string url, std::string& out_data )
{
	CookieManager::Cookies* p = cookies_manager_.GetCookies(url, true);
	if(p)
		p->GetString(NULL, out_data);
}
예제 #7
0
void Preferences::showCookieManager()
{
    CookieManager* m = new CookieManager();
    m->refreshTable();
    m->show();
}
예제 #8
0
void ClearPrivateData::showCookieManager()
{
    CookieManager* dialog = new CookieManager(this);
    dialog->open();
}
예제 #9
0
void MainMenu::showCookieManager()
{
    CookieManager* m = new CookieManager();
    m->show();
    m->raise();
}