RoleManagerSection.CookieRequireSSL 属性

定义

获取或设置一个值,该值指示用于缓存角色名称的 Cookie 是否需要一个安全套接字层 (SSL) 连接才能被返回到服务器。Gets or sets a value indicating whether the cookie that is used to cache role names requires a Secure Sockets Layer (SSL) connection in order to be returned to the server.

public:
 property bool CookieRequireSSL { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("cookieRequireSSL", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
public bool CookieRequireSSL { get; set; }
[<System.Configuration.ConfigurationProperty("cookieRequireSSL", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
member this.CookieRequireSSL : bool with get, set
Public Property CookieRequireSSL As Boolean

属性值

Boolean

如果需要一个 SSL 连接才能将缓存角色名称的 Cookie 返回到服务器,则为 true;否则,为 falsetrue if an SSL connection is needed in order to return to the server the cookie where role names are cached; otherwise, false. 默认值为 falseThe default is false.

属性

示例

下面的代码示例演示如何使用 CookieRequireSSL 属性。The following code example demonstrates how to use the CookieRequireSSL property. 此代码示例是为类提供的更大示例的一部分 RoleManagerSectionThis code example is part of a larger example provided for the RoleManagerSection class.

// Display CookieRequireSSL property.
Console.WriteLine("CookieRequireSSL: {0}",
  configSection.CookieRequireSSL);
' Display CookieRequireSSL property.
Console.WriteLine("CookieRequireSSL: {0}", _
 configSection.CookieRequireSSL)

注解

通过在 cookieRequireSSL ASP.NET 应用程序的 Web.config 文件中设置属性,可以指定是否需要 SSL 将角色名称 cookie 返回到服务器。You can specify whether SSL is required to return the role names cookie to the server by setting the cookieRequireSSL attribute in the Web.config file for your ASP.NET application.

适用于

另请参阅