You may notice that users sometimes have to log in again while they are using GSP.
This is caused by the recycling of the application domain, which clears out the session state and causes the server to lose all memory of those who are logged in. It is an annoying problem that plagues ASP.NET developers.
What causes the app domain to recycle? There are many reasons - here are a few of the most popular:
IIS may be configured to auto-recycle every X minutesThe default is 1740 minutes (29 hours). You can adjust the recycling settings in IIS Manager.
User deletes an albumSince albums are mapped to directories on the file system, deleting an album deletes a directory. ASP.NET is designed to automatically recycle whenever a directory is deleted within the web application heirarchy. To prevent the recycling, change the location of your mediaobjects directory to a folder outside the web application path. You can also create a
junction point.
Changes to config files and assemblies in the bin directoryEditing web.config, machine.config or the assemblies in the bin directory can cause the app to recycle.
Here is a nice
blog post that gets into some more detail about app domain recycling.
The easy fix: Move session storageYou can avoid losing your session state (and thus your logged on users) by moving session storage out of the app domain process. You have two choices: move it to the ASP.NET State Service or SQL Server. Documentation for both of these are easy to find, but here is a quick tutorial to configure GSP to use the ASP.NET State Service:
1. Start the Services applet on the server (Type services.msc in the Start menu).
2. Double click the ASP.NET State Service and configure it to start automatically. Then manually start it.
3. Open web.config for GSP and update the <sessionState> element to this:
Code:<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1" cookieless="false" timeout="60"/>
After moving session storage to an external process, your users should remain logged in even if the application domain recycles.
Roger Martin
Creator and Lead Developer of Gallery Server Pro