Tôi có một thử nghiệm Owin Server:Microsoft OWIN Kiểm tra máy chủ thiết lập cookie
using (var testServer = TestServer.Create<TestPipelineConfiguration>())
using (var client = new HttpClient(testServer.Handler))
{
client
.DefaultRequestHeaders
.Add("Cookie", $"{AspNetCookies}=HeyThere;");
client.BaseAddress = new Uri("https://testserver/");
var message = client
.PostAsync("print", new StringContent(
jsonProvider.SerialiseObject(new
{
Url = "https://some/url"
}),
Encoding.UTF8, "application/json"))
.Result;
//var message = client.GetAsync("test").Result;
message
.StatusCode
.ShouldBeEquivalentTo(HttpStatusCode.OK);
}
Tôi muốn thiết lập các tài sản khác trên cookie rằng, giống như HttpOnly
, Secure
và Domain
.
Điều này có khả thi không?
cách trả lời câu hỏi: 'Tôi muốn đặt các thuộc tính khác trên cookie đó, như HttpOnly, Secure and Domain' –