Ejemplo n.º 1
0
 public static void StoreSession(string sessionId, string userName, bool fromMemchaced = true, int exprieday = 1)
 {
     if (fromMemchaced)
     {
         Memached.SetValue(sessionId, userName, DateTime.Now.AddDays(exprieday));
     }
     else
     {
         if (cookieList.ContainsKey(sessionId))
         {
             cookieList.Remove(sessionId);
         }
         cookieList.Add(sessionId, userName);
     }
 }
Ejemplo n.º 2
0
        public static bool CheckValueIsExist(string sessionid, string value, bool fromMemcached = true)
        {
            bool isExist = false;

            if (fromMemcached)
            {
                isExist = Memached.GetValue(sessionid) == value && !string.IsNullOrEmpty(value);
            }
            else
            {
                if (cookieList.Keys.Contains(sessionid))
                {
                    if (cookieList[sessionid] == value)
                    {
                        isExist = true;
                    }
                }
            }
            return(isExist);
        }