Session is deleted when building project



When I build my project/solution all session-variables is deleted. This will 
be a problem for all users that currently is logged in because my solution 
show data for the spesific user based on the userID stored in a 
sessionvariable.

Is there any way go around this problem.... for example log out all users if 
session("userID")="" (blank)?
Is it possible to check this in the web.config file? Suggetions?

I use web.config to deny users, like this:

<authorization>
    <deny users="?" />
</authorization>


Thanks for all tips,
Isaksen


.