When it comes to the topic of using session objects within a web based application there is certainly a lot of controversy and discussion. Some developers believe the session should never be used or even be considered no matter what the design may be, while others grossly overuse it and stick massive amounts of information within it without considering the performance impact. A more reasonable middle of the road approach can be used in most situations without radically affecting performance while still providing some niceties to the end user experience.
In this tutorial we will build a simple functional ASP.NET web application which leverages a reasonable approach to implementing session objects. We will see how we can use an object oriented approach to this implementation in order to keep the session maintainable and the code very clean and easy to read.
The web application will be comprised of two main session object classes, one login page and one home page for displaying a welcome message and the session details. Providing even basic customized user data creates a personalized look and feel in your application where the user feels more involved in your application since they are given a sense that the application knows who they are and details about their previous visits.