Exemple #1
0
        public static void AsignarValorSession(String cNombreVariable, String Valor)
        {
            if (String.IsNullOrEmpty(Valor))
            {
                Valor = "0";
            }
            HttpCookie cookie = new HttpCookie(cNombreVariable, Encriptador.Encriptar(Valor));

            cookie.Expires = new DateTime(9999, 1, 1);
            HttpContext.Current.Response.Cookies.Add(cookie);
        }
Exemple #2
0
 public static int ObtenerValorSession(String cNombreVariable)
 {
     return(Convert.ToInt32(Encriptador.Desencriptar(HttpContext.Current.Request.Cookies[cNombreVariable].Value)));
 }