I need to implement several application-level behavior in a project I'm currently working on. There are several things I need to get my head around: 1. Where and how do I define application level variables? 2. What is the lifetime of these variables? or more accuratly, in what scenarios are they discarded? (Application pool recycle? App binaries dropped from memory and recompiled on the next request? etc.) 3. Is the global.asax file a good place to put a session counter, or maybe storing the value to a DB / file is a better way of persisting this kind of data?
Any comments or ideas are welcome. Thank you! -Elad