Listing 6 Inheriting from System.Web.UI.Page
public class MayaPage : System.Web.UI.Page { // current MayaSecurity class with role information MayaSecurity _mayaSecurity = null; protected override void OnInit(EventArgs e) { // check for an instance already cached in the Session _mayaSecurity = (MayaSecurity) Session["MayaSecurity"]; if ( _mayaSecurity == null ) { // none cached; create a new one _mayaSecurity = new MayaSecurity(User); // cache it in the Session object for the next page Session["MayaSecurity"] = _mayaSecurity; } // check User's access to this page AuthenticateUserForPage(); base.OnInit(e); } }