Setting Global Variables within an ASP.NET Web Project on Login and set Expiry Time

jinx83

New Member
I'm developing a revised version of a system I have been using for years, but with all the advantages of .NET features that were not around when I first made this.It's proving a steep learning curve!So, when a user logs in through my Login.aspx page which simply compares username/password to Database record, the system creates a session variable containing the user's Username and various other things.There are two type of variable which will be common to all elements of this system[*]User Specific data, Username, Permissions, etc[*]Setting variables, drawn from a database of pre-set facilities which are setup within the system, some will determine which facilities work, how they work, and some will be dependant upon the User's permission.Obviously, I could set everything within the Session data, but that'd be inefficient wouldn't it?If I were to set these globally available variables in my App_Code, how would I go about setting this up so that, for example, those variables which require a database call, are set for the duration of the Logged-In session and do not require constant Database lookups?Further to that, those variables which are dependant on the session state, would need clearing on each LogOut.I am using VB.NET.
 
Top