• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

Persistant Session Object that changes often

I have an object that im storing in session, that updates about 0-4 times per request.  Each changes needs to get stored in the databaes, although it does not have to be stored when it happens,  Im ok with saving the object at the end of the request, but it has to get all changes persisted regardless of waht the user does.

Any suggestions on how to do this?
1 Solution
Add a Global.asax file to your web site.  Global.asax will extend System.Web.HttpApplication and allow you to override the EndRequest event.  This event fires after asp.net has finished processing every request, so it would be the time to flush your Session variable to your DB.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now