Storing user variables in database vs session in asp.net -
I am working with an ASP.NET application that stores more data in a database and does not have session. I am thinking about the pros and cons of each and the best way to go. For example, you have a very busy site and instead of collecting user-specific variables in the session, there is a DB table named User Data And it can store all user-specific data that can be accessed from any page by querying the database. Which is the better way to go, session or database?
Interesting Questions If this is the data which is not important in sessions (say, last page has been viewed) -> Session If this is the data that should be consistent (e.g., password) -> Database interesting case and you might mention it: Data that should be continuous, but it is often used (say, username). From these, I copy those values from DB to Sessions, which allows me to work in pages with trivial work without database access.
Comments
Post a Comment