0
votes

Setting my forms authentication timeout and sessionState timeout from my config never seem to have the desired effect. I always have to set the sessionstate timeout on the website on the server and it also seems like I need to set the application pool idle timeout as well.

What is the point of the config setting if the server can just override it?

What are the priority of the settings, strictly in terms of authentication and the time to keep a user logged in? I have not done extensive testing on this but it feels like if any of the 4 settings are out of sync, the users don't get timed out predictably.

1

1 Answers

0
votes

The main thing is that they aren't related at all. Forms authentication timeout won't have anything to do with session timeout. Forms authentication timeouts may or may not slide and only store the authentication cookie. Even if they are set to slide a user still has to interact with the server after the halfway point in the timeout for it to slide, else it doesn't.

Session timeout is just there to store data for X amount of time if needed and the timeout will slide.

The application pool is there to keep everything running smoothly. Application pools need to recycle every so often and that can be disruptive, but it's the health of the app and the server they are worried in. Of course, if you aren't using a state server or storing session in database the session can end up killed off as well.

Couple things that help in this scenario: Use session wisely as it's a pig for resources, and always have a means to check for nulls and recreate the needed objects/values if it is null. Create a machinekey for your app. This will make sure the way that the app encrypts data doesn't change with each app recycle. If a recycle occurs it could have an effect on logged in users because the encryption of the ticket may not match. A nice side effect of creating an explicit machinekey can also help you use a webgarden if you want, but only if you a state server or store session in db since in memory session can't be shared among processes.

So they aren't inter-related but can effect each other. There is also no way in hell I would want an application to have it's own settings that would over-ride an app pool setting since a well set app pool keeps the site and server healthy and running well and that's the main reason it trumps all.