I tried to wean myself of lopping everything in a Session variable in ASP.NET (I came from a Windows programming background), and I generally completely stopped explicitly storing anything in a Session variable. Can anybody give some guidelines as to what you feel are acceptable uses of session variable?
Here's a specific example...I load a business object from the database and populate and edit screen. The user can edit the values and save. The old way I would load the business object, load my form, and save the business object to a session variable. If the user clicked save, I would retrieve the business object from the session variable, replace the edited values, and then save it. The new way I am loading the business object from the database and load my form. The user would edit the values and click save. I would reload my business object from the database, replace the edited values, and then save it. I'm no web programming expert but I feel the first way is wrong because of the bad stigma of using session variables, and I feel the second way is wrong because it just feels like a crappy way of doing it (loading the business object twice). Let's not take any form of caching into consideration here. How would I handle this?