From 41f83e8de4318971df4f885e08c14f4cf6b00987 Mon Sep 17 00:00:00 2001 From: RealRancor Date: Fri, 11 Sep 2015 16:51:07 +0200 Subject: [PATCH] Set HttpOnly for session cookie --- src/HTTPSock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HTTPSock.cpp b/src/HTTPSock.cpp index 6acbfbba..d37c3cb0 100644 --- a/src/HTTPSock.cpp +++ b/src/HTTPSock.cpp @@ -714,7 +714,7 @@ bool CHTTPSock::PrintHeader(off_t uContentLength, const CString& sContentType, u Write("Content-Type: " + m_sContentType + "\r\n"); for (const auto& it : m_msResponseCookies) { - Write("Set-Cookie: " + it.first.Escape_n(CString::EURL) + "=" + it.second.Escape_n(CString::EURL) + "; path=/;" + (GetSSL() ? "Secure;" : "") + "\r\n"); + Write("Set-Cookie: " + it.first.Escape_n(CString::EURL) + "=" + it.second.Escape_n(CString::EURL) + "; HttpOnly; path=/;" + (GetSSL() ? "Secure;" : "") + "\r\n"); } for (const auto& it : m_msHeaders) {