diff --git a/core/http/Cargo.toml b/core/http/Cargo.toml index af6a6447..e5e2ba24 100644 --- a/core/http/Cargo.toml +++ b/core/http/Cargo.toml @@ -23,7 +23,7 @@ private-cookies = ["cookie/secure"] smallvec = "1.0" percent-encoding = "1" hyper = { version = "0.10.13", default-features = false } -time = "0.2.9" +time = "0.2.11" indexmap = "1.0" rustls = { version = "0.16", optional = true } state = "0.4" diff --git a/core/http/src/cookies.rs b/core/http/src/cookies.rs index 8f5d958b..5887cd32 100644 --- a/core/http/src/cookies.rs +++ b/core/http/src/cookies.rs @@ -373,7 +373,7 @@ impl Cookies<'_> { } if cookie.expires().is_none() { - cookie.set_expires(time::OffsetDateTime::now() + time::Duration::weeks(1)); + cookie.set_expires(time::OffsetDateTime::now_utc() + time::Duration::weeks(1)); } if cookie.same_site().is_none() { diff --git a/core/lib/Cargo.toml b/core/lib/Cargo.toml index 3e196eb8..5e2109f1 100644 --- a/core/lib/Cargo.toml +++ b/core/lib/Cargo.toml @@ -31,7 +31,7 @@ log = "0.4" toml = "0.4.7" num_cpus = "1.0" state = "0.4.1" -time = "0.2.9" +time = "0.2.11" memchr = "2" # TODO: Use pear instead. binascii = "0.1" pear = "0.1" diff --git a/core/lib/src/local/request.rs b/core/lib/src/local/request.rs index 887c22f4..21abcb45 100644 --- a/core/lib/src/local/request.rs +++ b/core/lib/src/local/request.rs @@ -414,7 +414,7 @@ impl<'c> LocalRequest<'c> { // with the changes reflected by `response`. if let Some(ref jar) = client.cookies { let mut jar = jar.write().expect("LocalRequest::_dispatch() write lock"); - let current_time = time::OffsetDateTime::now(); + let current_time = time::OffsetDateTime::now_utc(); for cookie in response.cookies() { if let Some(expires) = cookie.expires() { if expires <= current_time {