Merge pull request #1080 from RealRancor/add_httponly_flag

Set HttpOnly for session cookie
This commit is contained in:
Alexey Sokolov
2015-09-19 13:55:19 +01:00
+1 -1
View File
@@ -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) {