SessionAuthenticationModule.IsReferenceMode 属性

定义

获取或设置一个值,该值指定是否应在会话 Cookie 中存储会话信息(声明值等),或是否应通过使用 Cookie 仅存储引用在服务器端上存储会话内容。Gets or sets a value that specifies whether the session information (claim values, etc.) should be stored in the session cookie or whether the session content should be stored on the server side, using the cookie to store just a reference.

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

属性值

Boolean

如果发布的 cookies 在引用模式中,则为 true;否则为 falsetrue if issued cookies are in reference mode; otherwise, false. 默认值为 false,指定了发布的 cookie 不处于引用模式。The default is false, which specifies that issued cookies are not in reference mode.

注解

在引用模式下, SessionSecurityToken 存储在服务器端缓存 (从) 派生的对象 SessionSecurityTokenCacheIn reference mode, the SessionSecurityToken is stored in a server-side cache (an object that derives from SessionSecurityTokenCache). 发出的 cookie 只包含用于从缓存中检索令牌的上下文标识符。The issued cookie just contains a context identifier that is used to retrieve the token from the cache.

重要

若要在引用模式下操作,Microsoft 建议为 WSFederationAuthenticationModule.SessionSecurityTokenCreated global.asax .cs 文件中的事件提供处理程序,并在 SessionSecurityToken.IsReferenceMode 属性中传递的标记上设置属性 SessionSecurityTokenCreatedEventArgs.SessionTokenTo operate in reference mode, Microsoft recommends providing a handler for the WSFederationAuthenticationModule.SessionSecurityTokenCreated event in the global.asax.cs file and setting the SessionSecurityToken.IsReferenceMode property on the token passed in the SessionSecurityTokenCreatedEventArgs.SessionToken property. 这将确保会话令牌在对每个请求的引用模式下运行,并且优于仅在 SessionAuthenticationModule.IsReferenceMode 会话身份验证模块上设置属性。This will ensure that the session token operates in reference mode for every request and is favored over merely setting the SessionAuthenticationModule.IsReferenceMode property on the Session Authentication Module.

适用于