Ejemplo n.º 1
0
 /// <summary>
 /// Resets a session timeout
 /// </summary>
 /// <param name="context">The current request context</param>
 /// <param name="id">The session id</param>
 public override void ResetItemTimeout(HttpContext context, string id)
 {
     // Force a session get to update its timeout
     var ids       = SharedSessionIDManager.GetSessionIdAndServer(id);
     var timestamp = SharedSessionIDManager.GetSessionTimestamp(id);
     var data      = SharedSessionServerManager.GetData(ids[1], ids[0], timestamp);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns read-only session-state data from the session data store.
        /// </summary>
        /// <param name="context">The current request context</param>
        /// <param name="id">The session id</param>
        /// <param name="locked">Indicates if the item is locked in the data store (always false)</param>
        /// <param name="lockAge">Indicates the age of the lock (always TimeSpan.MaxValue)</param>
        /// <param name="lockId">An object that represents the lock ID</param>
        /// <param name="actions">Actions to perform after the request (always SessionStateActions.None)</param>
        /// <returns></returns>
        public override SessionStateStoreData GetItem(
            HttpContext context,
            string id,
            out bool locked,
            out TimeSpan lockAge,
            out object lockId,
            out SessionStateActions actions)
        {
            var ids       = SharedSessionIDManager.GetSessionIdAndServer(id);
            var timestamp = SharedSessionIDManager.GetSessionTimestamp(id);
            var data      = SharedSessionServerManager.GetData(ids[1], ids[0], timestamp);

            locked  = false;
            lockAge = TimeSpan.MaxValue;
            lockId  = new Object();
            actions = SessionStateActions.None;

            return(Deserialize(context, data.Data, data.TimeOut));
        }