public async Task <ActionResult> AddCommentPost(Comment comment) { var cookie = Request.Cookies["Login"]; var idCookie = Request.Cookies["postID"]; if (cookie != null) { if (idCookie != null) { comment.User = cookie["username"]; comment.PostID = int.Parse(idCookie["id"]); var c = new HttpCookie("postID"); c.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Add(c); var status = await _blogService.AddComment(commentWCFChanger(comment)); if (status.Equals("Error")) { return(View("Error")); } return(View()); } else { return(View("Error")); } } else { return(View("PermissionError")); } }