summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_http_job.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 04:27:47 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 04:27:47 +0000
commit4f79b3f0a594fab40f6afa6577503b7e33d866f2 (patch)
treed6ef4256e95e0d188880e65c49773a23b1990cb0 /net/url_request/url_request_http_job.cc
parentf79b6495a07ca8c54ef9ccc2113304bf754b5fe2 (diff)
downloadchromium_src-4f79b3f0a594fab40f6afa6577503b7e33d866f2.zip
chromium_src-4f79b3f0a594fab40f6afa6577503b7e33d866f2.tar.gz
chromium_src-4f79b3f0a594fab40f6afa6577503b7e33d866f2.tar.bz2
Implement backend support for forcing cookies to be saved as
session cookies. Introduces a new CookiePolicy result code OK_FOR_SESSION_ONLY. R=eroman BUG=34571 TEST=none Review URL: http://codereview.chromium.org/577013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_http_job.cc')
-rw-r--r--net/url_request/url_request_http_job.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 25b0f33..05fd0f2 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -432,7 +432,7 @@ bool URLRequestHttpJob::ReadRawData(net::IOBuffer* buf, int buf_size,
void URLRequestHttpJob::OnCanGetCookiesCompleted(int policy) {
// If the request was destroyed, then there is no more work to do.
if (request_ && request_->delegate()) {
- if (policy == net::OK && request_->context()->cookie_store()) {
+ if (request_->context()->cookie_store() && policy == net::OK) {
net::CookieOptions options;
options.set_include_httponly();
std::string cookies =
@@ -450,10 +450,14 @@ void URLRequestHttpJob::OnCanGetCookiesCompleted(int policy) {
void URLRequestHttpJob::OnCanSetCookieCompleted(int policy) {
// If the request was destroyed, then there is no more work to do.
if (request_ && request_->delegate()) {
- if (policy == net::OK && request_->context()->cookie_store()) {
+ if (request_->context()->cookie_store() &&
+ (policy == net::OK ||
+ policy == net::OK_FOR_SESSION_ONLY)) {
// OK to save the current response cookie now.
net::CookieOptions options;
options.set_include_httponly();
+ if (policy == net::OK_FOR_SESSION_ONLY)
+ options.set_force_session();
request_->context()->cookie_store()->SetCookieWithOptions(
request_->url(), response_cookies_[response_cookies_save_index_],
options);