标签: c# asp.net-mvc
如何设置Cookie的路径自定义路径
答案 0 :(得分:4)
只需设置HttpCookie.Path属性。
HttpCookie.Path
public HttpCookie CreateCookie(string name, string value, string path) { var cookie = new HttpCookie(name, value); cookie.Path = path; return cookie; }