private void InitializeFromWebConfig(ISessionStateContext context) { var systemWebConfiguration = new SystemWebConfiguration(context.VirtualDirectoryPath); var connectionString = systemWebConfiguration.SessionState.SqlConnectionString; _timeout = (int)systemWebConfiguration.SessionState.Timeout.TotalMinutes; _sessionStore = new SqlSessionStateStore(connectionString, _timeout); }
public void Should_Read_Existing_Value_From_Session_Config() { var webConfiguration = new SystemWebConfiguration(Environment.CurrentDirectory); webConfiguration.SessionState.SqlConnectionString.ShouldEqual("server=localhost;database=ASPNetSessionState;Integrated Security=SSPI"); }
public void Should_Read_Missing_Value_From_Sessionb_Config() { var webConfiguration = new SystemWebConfiguration(Environment.CurrentDirectory); webConfiguration.SessionState.StateNetworkTimeout.ShouldEqual(new TimeSpan(0, 0, 10)); }