I have built small example with asp.net web api. I create a api for authentication. I try to use set-cookie response header when user logged in successful. But in next request, i can't find cookie in header. Can anybody help me? Thanks a lot!!!
if (repository.CheckValidUser(user))
{
var resp = new HttpResponseMessage();
var cookie = new CookieHeaderValue("Authorization-Token", RSAClass.Encrypt(user.Username));
cookie.Expires = DateTimeOffset.Now.AddDays(1);
cookie.Domain = Request.RequestUri.Host;
cookie.Path = "/";
resp.Headers.AddCookies(new CookieHeaderValue[] { cookie });
return resp;
}
else
{
throw new HttpResponseException(new HttpResponseMessage() { StatusCode = HttpStatusCode.Unauthorized, Content = new StringContent("Invalid user name or password.") });
}
I have some photos about my request

