/// <summary>
        /// Initialize values from web.config.
        /// </summary>
        public override void Initialize(string name, NameValueCollection config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (name == null || name.Length == 0)
            {
                name = "SQLiteSessionStateStore";
            }

            if (String.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "SQLite Session State Store provider");
            }

            // Initialize the abstract base class.
            base.Initialize(name, config);

            // Initialize the ApplicationName property.
            ApplicationName = System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath;

            // Get <sessionState> configuration element.
            Configuration cfg = WebConfigurationManager.OpenWebConfiguration(ApplicationName);

            _config = (SessionStateSection)cfg.GetSection("system.web/sessionState");

            // Initialize connection string.
            var databaseFile = config["databaseFile"];

            if (databaseFile == null || string.IsNullOrWhiteSpace(databaseFile))
            {
                throw new ProviderException("Configuration 'databaseFile' must be specified for SqliteSessionStateStoreProvider.");
            }

            //Try and map the database to the location on the server.
            //This will allow databse files to be specified as ~/Folder
            var currentContext = HttpContext.Current;

            if (currentContext != null)
            {
                databaseFile = currentContext.Server.MapPath(databaseFile);
            }

            _connectionString = "Data Source =" + databaseFile;

            var schemagenerator = new SchemaGenerator(databaseFile);

            schemagenerator.Create();

            //Setup cleanup timer to remove old session data
            _cleanupTimer          = new Timer(_config.Timeout.TotalMilliseconds);
            _cleanupTimer.Elapsed += (sender, e) => CleanUpExpiredData();

            // Initialize WriteExceptionsToEventLog
            var writeExceptionsToEventLog = config["writeExceptionsToEventLog"];

            if (writeExceptionsToEventLog != null && writeExceptionsToEventLog.Equals("true", StringComparison.OrdinalIgnoreCase))
            {
                WriteExceptionsToEventLog = true;
            }
        }
        /// <summary>
        /// Initialize values from web.config.
        /// </summary>
        public override void Initialize(string name, NameValueCollection config)
        {
            if (config == null)
                throw new ArgumentNullException("config");

            if (name == null || name.Length == 0)
                name = "SQLiteSessionStateStore";

            if (String.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "SQLite Session State Store provider");
            }

            // Initialize the abstract base class.
            base.Initialize(name, config);

            // Initialize the ApplicationName property.
            ApplicationName = System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath;

            // Get <sessionState> configuration element.
            Configuration cfg = WebConfigurationManager.OpenWebConfiguration(ApplicationName);
            _config = (SessionStateSection)cfg.GetSection("system.web/sessionState");

            // Initialize connection string.
            var databaseFile = config["databaseFile"];
            if (databaseFile == null || string.IsNullOrWhiteSpace(databaseFile))
                throw new ProviderException("Configuration 'databaseFile' must be specified for SqliteSessionStateStoreProvider.");

            //Try and map the database to the location on the server.
            //This will allow databse files to be specified as ~/Folder
            var currentContext = HttpContext.Current;
            if (currentContext != null)
                databaseFile = currentContext.Server.MapPath(databaseFile);

            _connectionString = "Data Source =" + databaseFile;

            var schemagenerator = new SchemaGenerator(databaseFile);
            schemagenerator.Create();

            //Setup cleanup timer to remove old session data
            _cleanupTimer = new Timer(_config.Timeout.TotalMilliseconds);
            _cleanupTimer.Elapsed += (sender,e) => CleanUpExpiredData();

            // Initialize WriteExceptionsToEventLog
            var writeExceptionsToEventLog = config["writeExceptionsToEventLog"];
            if (writeExceptionsToEventLog != null && writeExceptionsToEventLog.Equals("true", StringComparison.OrdinalIgnoreCase))
                WriteExceptionsToEventLog = true;
        }