Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie userCookie;
            HttpCookie passCookie;

            userCookie = Request.Cookies["UserID"];
            passCookie = Request.Cookies["UserPass"];

            if (userCookie == null || passCookie == null)
            {
                Response.Redirect("../Account/Login.aspx");
            }
            else
            {
                User_Class usuario_sesion = new User_Class();
                usuario_sesion = usuario_sesion.getUser(userCookie.Value);

                if (usuario_sesion.Pass == passCookie.Value)
                {
                    usuario_sesion.deleteFriend(int.Parse(Request.QueryString["id"]));
                    Response.Redirect("../Asp_forms/Friends.aspx");
                }
                else
                {
                    Response.Redirect("../Account/Login.aspx");
                }
            }
        }