public ActionResult GetUsernameInCookie() { bool status = false; string msg = ""; var cookie = Request["contenido"]; string cookie_content = funcion.base64_decode(cookie); string username = ""; try { username = conexion_now.get_username_in_cookie(cookie_content); status = true; msg = username; } catch { status = false; msg = username; } return(Json(new { success = status, message = msg })); }
// Validaciones de cookies public bool valid_cookie(string cookie_content) { cookie_content = funcion.base64_decode(cookie_content); string[] datos = cookie_content.Split(':'); string username_cookie = datos[0]; string password_cookie = datos[1]; if (username_cookie != "" && password_cookie != "") { if (ingreso_usuario(username_cookie, password_cookie)) { return(true); } else { return(false); } } else { return(false); } }