Say you want to run a 3rd party .NET app in a virtual direcotory outside of your SharePoint sites (or inside), you will need the following in the web.config file of that app.
<system.web>
<pages enableSessionState="true" />
<httpModules>
<clear />
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
</system.web>
Reason: By default SharePoint disables SessionState.
Here is an excellent MS Article on Session State