HttpCookie cookie = new HttpCookie("RealName", HttpUtility.UrlEncode("你想要设置的值")); Response.SetCookie(cookie);