using System; using System.Collections.Specialized; using System.Net; using System.Net.Mail; using SiberTek.Xenta.Config; using SiberTek.Xenta.Entities; using SiberTek.Xenta.Enums; using SiberTek.Xenta.Managers; using SiberTek.Xenta.Utils; using System.Collections.Generic; namespace SiberTek.Xenta.Tasks { /// <summary> /// Cleans expired user sessions /// </summary> public class UserSessionsCleaner : ITask { #region Fields private bool _initalized; private readonly TimeSpan _period; #endregion #region Constructors public UserSessionsCleaner() { _initalized = false; _period = TimeSpan.FromSeconds(5); } #endregion #region Properties public TimeSpan Period { get { return _period; } } #endregion #region Methods public void Initialize(NameValueCollection properties) { if(!_initalized) { _initalized = true; } } public void TaskProc() { foreach(UserSessionInfo session in UserManager.Instance.GetExpiredUserSessions()) { UserManager.Instance.CloseUserSession(session.SessionID); } } #endregion } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The MIT License