0
Good afternoon I have an application in MVC that generates some cookies, I wonder if it is possible to redeem these cookies through an Api, because I tried and unfortunately could not.
Code generated for the api:
[Route("ResgataCookie")]
[HttpGet]
public IHttpActionResult ResgataCookie()
{
string test = "";
if (HttpContext.Current.Request.Cookies["RMACookies"] != null)
{
test = HttpContext.Current.Request.Cookies["RMACookies"].Value;
}
return Ok(test);
}
Hello friend I did that way, too, but the same returns me null. cookies are generated in a standard MVC application, but I am trying to access cookies through the api and unfortunately return blank.
– Jefferson
Are you trying to access cookies from another application? Remembering that cookies are stored by domains and sub-domains so if they are different you won’t even have access.
– Danilo Ribeiro da Silveira
Thank you very much Danilo.
– Jefferson