HttpCookie.Shareable 属性

定义

确定是否允许 Cookie 参与输出缓存。

public:
 property bool Shareable { bool get(); void set(bool value); };
public bool Shareable { get; set; }
member this.Shareable : bool with get, set
Public Property Shareable As Boolean

属性值

如果指定为包含一个或多个出站 Cookie 的给定 ,则不会禁止输出缓存;否则为 < a0/>。

注解

如果给定HttpResponse包含一个或多个设置为Shareable(默认值)的出站 Cookiefalse,则响应将禁止输出缓存。 这可以防止包含潜在敏感信息的 Cookie 在响应中缓存并发送到多个客户端。 若要允许缓存包含 Cookie 的响应,请为响应配置缓存,例如使用 OutputCache 指令或 MVC 的 [OutputCache] 属性,并将所有出站 Cookie 设置为已 Shareable 设置为 true

适用于