mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fixed an issue identified by Un1matr1x: If you were running two 0.090 ZNCs on the same IP,
(but different ports), any web login session from ZNC #1 would overwrite the session from ZNC #2. While doing this, also removed an unnecessary check in CHTTPSock::SendCookie and CHTTPSock::GetRequestCookies (which doesn't transparently translate cookie names and has never been used so far). git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2030 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -458,25 +458,29 @@ bool CWebSock::ForceLogin() {
|
||||
return false;
|
||||
}
|
||||
|
||||
CString CWebSock::GetRequestCookie(const CString& sKey) const {
|
||||
CString CWebSock::GetRequestCookie(const CString& sKey) {
|
||||
const CString sPrefixedKey = CString(GetLocalPort()) + "-" + sKey;
|
||||
CString sRet;
|
||||
|
||||
if (!m_sModName.empty()) {
|
||||
sRet = CHTTPSock::GetRequestCookie("Mod::" + m_sModName + "::" + sKey);
|
||||
sRet = CHTTPSock::GetRequestCookie("Mod-" + m_sModName + "-" + sPrefixedKey);
|
||||
}
|
||||
|
||||
if (sRet.empty()) {
|
||||
return CHTTPSock::GetRequestCookie(sKey);
|
||||
return CHTTPSock::GetRequestCookie(sPrefixedKey);
|
||||
}
|
||||
|
||||
return sRet;
|
||||
}
|
||||
|
||||
bool CWebSock::SendCookie(const CString& sKey, const CString& sValue) {
|
||||
const CString sPrefixedKey = CString(GetLocalPort()) + "-" + sKey;
|
||||
|
||||
if (!m_sModName.empty()) {
|
||||
return CHTTPSock::SendCookie("Mod::" + m_sModName + "::" + sKey, sValue);
|
||||
return CHTTPSock::SendCookie("Mod-" + m_sModName + "-" + sPrefixedKey, sValue);
|
||||
}
|
||||
|
||||
return CHTTPSock::SendCookie(sKey, sValue);
|
||||
return CHTTPSock::SendCookie(sPrefixedKey, sValue);
|
||||
}
|
||||
|
||||
void CWebSock::OnPageRequest(const CString& sURI) {
|
||||
|
||||
Reference in New Issue
Block a user