Send HttpOnly (if applicable) when deleting cookies (#12593)
This commit is contained in:
parent
d7bfbb5824
commit
331ff2404d
|
|
@ -190,7 +190,7 @@ namespace Microsoft.AspNetCore.Authentication.WsFederation
|
||||||
response.EnsureSuccessStatusCode();
|
response.EnsureSuccessStatusCode();
|
||||||
|
|
||||||
var cookie = response.Headers.GetValues(HeaderNames.SetCookie).Single();
|
var cookie = response.Headers.GetValues(HeaderNames.SetCookie).Single();
|
||||||
Assert.Equal(".AspNetCore.Cookies=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax", cookie);
|
Assert.Equal(".AspNetCore.Cookies=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax; httponly", cookie);
|
||||||
Assert.Equal("OnRemoteSignOut", response.Headers.GetValues("EventHeader").Single());
|
Assert.Equal("OnRemoteSignOut", response.Headers.GetValues("EventHeader").Single());
|
||||||
Assert.Equal("", await response.Content.ReadAsStringAsync());
|
Assert.Equal("", await response.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -289,6 +289,7 @@ namespace Microsoft.AspNetCore.Internal
|
||||||
Secure = options.Secure,
|
Secure = options.Secure,
|
||||||
IsEssential = options.IsEssential,
|
IsEssential = options.IsEssential,
|
||||||
Expires = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc),
|
Expires = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc),
|
||||||
|
HttpOnly = options.HttpOnly,
|
||||||
});
|
});
|
||||||
|
|
||||||
for (int i = 1; i <= chunks; i++)
|
for (int i = 1; i <= chunks; i++)
|
||||||
|
|
@ -305,6 +306,7 @@ namespace Microsoft.AspNetCore.Internal
|
||||||
Secure = options.Secure,
|
Secure = options.Secure,
|
||||||
IsEssential = options.IsEssential,
|
IsEssential = options.IsEssential,
|
||||||
Expires = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc),
|
Expires = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc),
|
||||||
|
HttpOnly = options.HttpOnly,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue