StrataFrame Security Documentation Send comments on this topic.
Required Global.asax Code

Glossary Item Box

Required Global.asax Code

All of the code required to configure a StrataFrame web application for use with the StrataFrame Security Module should be placed within the Application_Start() method.  This is since the method is only called once, during the first page request after the website’s application pool is restarted.

IsWebEnvironment

The MicroFour.StrataFrame.Security.SecurityBasics class contains the shared (static) property IsWebEnvironment.  This property is used to indicate to the security module that the security is being run from within a web application and that the session objects should be used to store the CurrentUser and other session specific data. The IsWebEnvironment property should be set at the top of the Application_Start() method within the Global.asax file.

Sample - Setting the IsWebEnvironment Property [Visual Basic]
Imports MicroFour.StrataFrame.Security
...
Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    '-- Set the property
    SecurityBasics.IsWebEnvironment = True
End Sub

Sample - Setting the IsWebEnvironment Property [C#]
using MicroFour.StrataFrame.Security;
...
protected void Application_Start(object sender, EventArgs e)
{
    //-- Set the property
    SecurityBasics.IsWebEnvironment = true;
}

Other Required Global.asax Code

Other than the IsWebEnvironment variable, the code required to enable specific pieces of the security module within a web application is the same as required within a Windows application. Therefore, any AppMain.vb (program.cs) code that is required for a Windows application should be placed within the Global.asax file of a web application. 

A complete description of all code required in AppMain.vb (program.cs) may be found under the Programmatic Access section of this help file.