diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 04:27:47 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 04:27:47 +0000 |
commit | 4f79b3f0a594fab40f6afa6577503b7e33d866f2 (patch) | |
tree | d6ef4256e95e0d188880e65c49773a23b1990cb0 /net/base/cookie_monster.cc | |
parent | f79b6495a07ca8c54ef9ccc2113304bf754b5fe2 (diff) | |
download | chromium_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/base/cookie_monster.cc')
-rw-r--r-- | net/base/cookie_monster.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index 6cda7e5..595bf06 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -361,7 +361,11 @@ static std::string CanonPath(const GURL& url, } static Time CanonExpiration(const CookieMonster::ParsedCookie& pc, - const Time& current) { + const Time& current, + const CookieOptions& options) { + if (options.force_session()) + return Time(); + // First, try the Max-Age attribute. uint64 max_age = 0; if (pc.HasMaxAge() && @@ -445,7 +449,7 @@ bool CookieMonster::SetCookieWithCreationTimeAndOptions( std::string cookie_path = CanonPath(url, pc); scoped_ptr<CanonicalCookie> cc; - Time cookie_expires = CanonExpiration(pc, creation_time); + Time cookie_expires = CanonExpiration(pc, creation_time, options); cc.reset(new CanonicalCookie(pc.Name(), pc.Value(), cookie_path, pc.IsSecure(), pc.IsHttpOnly(), |