I guess the moment you make changes to the web.config of a web app which is already running, it will restart the whole AppDomain of the application. Hence if your session mode is "inProc", then you will loose the session details when the Appdomain is restarted
I suggest you configure your session mode to any of the "out of process" modes which can be either StateServer or SQLServer.
Read up on this here
http://msdn.microsoft.com/en-us/library/ms972429.aspx[
^]