Core functionality for advanced-flag based session timeouts.