Exemple #1
0
        protected override byte[] SerializeSession(object sessionData)
        {
            if (sessionData != null)
            {
                return(SessionSerializationUtil.Serialize(sessionData as SessionStateStoreData));
            }

            return(null);
        }
        /// <summary>
        /// Form a hashtable to be added to cache
        /// </summary>
        /// <param name="context"></param>
        /// <param name="data"></param>
        /// <param name="flag"></param>
        /// <param name="timeout"></param>
        /// <returns></returns>
        private Hashtable InsertContents(HttpContext context, SessionStateStoreData data, SessionStateActions flag, int timeout)
        {
            Hashtable items = new Hashtable(4);

            if (data != null)
            {
                byte[] buffer = SessionSerializationUtil.Serialize(data);
                items.Add(SESSION_DATA, buffer);
                items.Add(TIMEOUT_KEY, (int)data.Timeout);
            }
            else
            {
                items.Add(TIMEOUT_KEY, (int)timeout);
            }

            items.Add(ACTIONS_KEY, flag);

            return(items);
        }