I tried to wean myself from using everything in the Session variable in ASP.NET (I came from the Windows programming background), and I completely stopped explicitly storing anything in the Session variable. Can someone give some recommendations regarding what you think is an acceptable use of a session variable?
Here is an example ... I load a business object from a database and fill and edit the screen. User can edit values ββand save. The old way to load a business object, load a form, and save the business object into a session variable. If the user clicked the Save button, I would extract the business object from the session variable, replace the edited values, and save it. A new way to load a business object from the database and load my form. The user will edit the values ββand click "Save." I would reload my business object from the database, replace the edited values ββand save them. I am not a web programming expert, but I feel that the first way is wrong due to the bad stigma of using session variables, and I feel that the second way is wrong.because it just feels like a shitty way to do this (loading a business object twice). Do not consider any form of caching here. How would I handle this?
source
share