public IActionResult Delete() { //删除cookie Response.Cookies.Delete(_key); //再次读取看是否还有 var username = Request.Cookies[_key]; _hostIp = HttpContext.Connection.LocalIpAddress.ToString(); return Content(username + ",ip: " + _hostIp); }
难道是因为调用Delete方法之后,Request对象没更新的原因?
是的,Request没更新,也不需要更新,也不应该更新