SessionStateModule 类

定义

为应用程序提供会话状态服务。Provides session-state services for an application. 此类不能被继承。This class cannot be inherited.

public ref class SessionStateModule sealed : System::Web::SessionState::ISessionStateModule
public sealed class SessionStateModule : System.Web.SessionState.ISessionStateModule
type SessionStateModule = class
    interface ISessionStateModule
    interface IHttpModule
Public NotInheritable Class SessionStateModule
Implements ISessionStateModule
继承
SessionStateModule
实现

注解

SessionStateModule是 ASP。NET 的默认会话状态处理程序。SessionStateModule is ASP.NET's default session-state handler. 它将会话数据写入到会话状态存储, 并从会话状态存储中检索它, 并引发Session_OnStartSession_OnEnd事件。It writes session data to and retrieves it from the session-state store and raises the Session_OnStart and Session_OnEnd events. 有关如何使用 ASP.NET 会话状态来存储和检索用户会话值的详细信息, 请参阅ASP.NET 会话状态概述For details about how to use ASP.NET session state to store and retrieve values for a user session, see ASP.NET Session State Overview.

可以将替换SessionStateModule为管理会话状态的IHttpModule接口的自定义实现。You can replace the SessionStateModule with a custom implementation of the IHttpModule interface that manages session state. 有关自定义会话状态模块的示例, 请参阅SessionStateUtility类概述。For an example of a custom session-state module, see the SessionStateUtility class overview.

构造函数

SessionStateModule()

初始化 SessionStateModule 类的新实例。Initializes a new instance of the SessionStateModule class.

方法

Dispose()

在从内存释放 SessionStateModule 对象之前执行最终的清理代码。Executes final cleanup code before the SessionStateModule object is released from memory.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Init(HttpApplication)

在创建 SessionStateModule 对象时调用初始化代码。Calls initialization code when a SessionStateModule object is created.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ReleaseSessionState(HttpContext)

释放指定 HttpContext 的会话状态。Releases the session state for the specified HttpContext.

ReleaseSessionStateAsync(HttpContext)

以异步方式释放指定 HttpContext 的会话状态。Asynchronously releases the session state for the specified HttpContext.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

事件

End

在会话结束时发生。Occurs when a session ends.

Start

创建会话时发生的事件。The event that occurs when a session is created.

适用于

另请参阅