From b953def79ddb2657e8eb49dcc63aa99b4b8bdc28 Mon Sep 17 00:00:00 2001 From: "EMEA\\norbertvirth" Date: Wed, 27 Mar 2019 15:51:13 +0100 Subject: [PATCH] BugFix: Common/FileDownloadAttribute.cs: Cookie made not HttpOnly --- src/Common/FileDownloadAttribute.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Common/FileDownloadAttribute.cs b/src/Common/FileDownloadAttribute.cs index 5457ec1..e103a21 100644 --- a/src/Common/FileDownloadAttribute.cs +++ b/src/Common/FileDownloadAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; using System.Web.Mvc; @@ -29,12 +29,12 @@ private void CheckAndHandleFileResult(ActionExecutedContext filterContext) if (filterContext.Result is FileResult) //jquery.fileDownload uses this cookie to determine that a file download has completed successfully - response.AppendCookie(new HttpCookie(CookieName, "true") { Path = CookiePath }); + response.AppendCookie(new HttpCookie(CookieName, "true") { Path = CookiePath, HttpOnly = false }); else //ensure that the cookie is removed in case someone did a file download without using jquery.fileDownload if (httpContext.Request.Cookies[CookieName] != null) { - response.AppendCookie(new HttpCookie(CookieName, "true") { Expires = DateTime.Now.AddYears(-1), Path = CookiePath }); + response.AppendCookie(new HttpCookie(CookieName, "true") { Expires = DateTime.Now.AddYears(-1), Path = CookiePath, HttpOnly = false }); } }