Use "Out-of-process" model
instead of using "In-Process" model.
In the case of In-Process model, session data is stored in the ASP.NET processes memory area. So if the application is
restarted, your entire session data will lose.
In the case of Out-of-process model, session data is stored in the Server memory as a separate process. So it will
helps you to keep data intact even if the application is restarted.
Eg:
<system.web>
<sessionState
timeout="60" mode="StateServer"></sessionState>
</system.web>