SessionStateModule.Init(HttpApplication) Method

Definition

Calls initialization code when a SessionStateModule object is created.

public:
 virtual void Init(System::Web::HttpApplication ^ app);
public void Init (System.Web.HttpApplication app);
abstract member Init : System.Web.HttpApplication -> unit
override this.Init : System.Web.HttpApplication -> unit
Public Sub Init (app As HttpApplication)

Parameters

app
HttpApplication

The current application.

Implements

Exceptions

The mode attribute in the sessionState Element (ASP.NET Settings Schema) configuration element is set to StateServer or SQLServer, and the ASP.NET application has less than Medium trust.

The mode attribute in the sessionState Element (ASP.NET Settings Schema) configuration element is set to Custom and the customProvider attribute is empty or does not exist.

-or-

The mode attribute in the sessionState Element (ASP.NET Settings Schema)](https://video2.skills-academy.com/previous-versions/dotnet/netframework-4.0/h6bb9cz9(v=vs.100)) configuration element is set to Custom and the provider identified by name in the customProvider attribute has not been added to the [providers Element for sessionState (ASP.NET Settings Schema) sub-element.

Remarks

This method is not intended to be called from application code.

An HttpApplication is created when an ASP.NET application is started. The HttpApplication object calls the Init method when it creates the SessionStateModule object for the application. The SessionStateModule class is specified in the configuration for an application.

Applies to

See also