diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 23:43:50 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 23:43:50 +0000 |
commit | 079786397d052c14a2b1886dfb494c4bd4a9335c (patch) | |
tree | 14069b5cf462e23f2406a5cbb48fd2a36985d5da /chrome_frame/urlmon_url_request.cc | |
parent | 027f4d4575f330822d17f09b25eebe31ace131c5 (diff) | |
download | chromium_src-079786397d052c14a2b1886dfb494c4bd4a9335c.zip chromium_src-079786397d052c14a2b1886dfb494c4bd4a9335c.tar.gz chromium_src-079786397d052c14a2b1886dfb494c4bd4a9335c.tar.bz2 |
Cookies would not get set correctly in ChromeFrame in full tab mode. The code to set cookies in IE incorrectly parses the cookies into name
value pairs. In this scenario we end up with an empty name string which causes cookies to not get set correctly. It appears that an empty
name string is not treated on the same lines as NULL. In any case we should not be doing any parsing and should just set the cookie as is.
This fixes bug http://code.google.com/p/chromium/issues/detail?id=42818. Added a unit test to validate this case.
Bug=42818
Review URL: http://codereview.chromium.org/1917005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46523 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.cc')
-rw-r--r-- | chrome_frame/urlmon_url_request.cc | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 961b7da..0843ef2 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -1100,33 +1100,9 @@ void UrlmonUrlRequestManager::GetCookiesForUrl(const GURL& url, int cookie_id) { void UrlmonUrlRequestManager::SetCookiesForUrl(const GURL& url, const std::string& cookie) { - std::string name; - std::string data; - - size_t name_end = cookie.find('='); - if (std::string::npos != name_end) { - net::CookieMonster::ParsedCookie parsed_cookie = cookie; - name = parsed_cookie.Name(); - // Verify if the cookie is being deleted. The cookie format is as below - // value[; expires=date][; domain=domain][; path=path][; secure] - // If the first semicolon appears immediately after the name= string, - // it means that the cookie is being deleted, in which case we should - // pass the data as is to the InternetSetCookie function. - if (!parsed_cookie.Value().empty()) { - name.clear(); - data = cookie; - } else { - data = cookie.substr(name_end + 1); - } - } else { - data = cookie; - } - - int32 flags = INTERNET_COOKIE_EVALUATE_P3P; - InternetCookieState cookie_state = static_cast<InternetCookieState>( - InternetSetCookieExA(url.spec().c_str(), name.c_str(), data.c_str(), - flags, NULL)); + InternetSetCookieExA(url.spec().c_str(), NULL, cookie.c_str(), + INTERNET_COOKIE_EVALUATE_P3P, NULL)); int32 cookie_action = MapCookieStateToCookieAction(cookie_state); AddPrivacyDataForUrl(url.spec(), "", cookie_action); |