I usually just assign session variables as I need them...I don't really know if that's best practice or not. They aren't stored anywhere but in the web server's memory...you could write them to a database for long-term storage if you want. For session variables that always have an initial value that you want all users to initialize with, you can create them in the global.asax file. There are some great beginner videos at http://msdn.microsoft.com/vstudio/ex...ult.aspx#video
. They are for Visual Web Developer, but they mostly apply to VS as well. There is one on state management that will get you started pretty well.
My understanding is that ASP.NET 2.0 handles them more efficiently than previous versions, but I suppose that if you have enough of them and lots of visitors to the site, you could run into memory problems. Still, I believe it's what most people use. Using profiles is an alternative to session variables in some cases, because it writes the values to a database, are strongly typed, and handles all the database stuff automatically. There are varying opinions on when you should use profiles and when you should use session variables, but I think the consensus is to use profiles for user-specific info, such as name, address, etc. that you want to keep, and use session variables for temporary storage of data that you want available for each page. The fact is, either can be used for either. The web server only keeps session variables in memory for as long as the session lasts. So if you are on a site and you close the browser, or even leave the page sitting until the timeout has expired (default is 30 min. I think), the web server releases those variables automatically.
Hang in there...I'm still new at this stuff too...I'm working on a project for a client that presents in some ways to me a "trial by fire", but I learn best that way anyway.