Bugfix for CWebSock::GetRequestCookie()

When a module page is requested, m_sModName is set. When then GetSession() tries
to look up its session cookie, it doesn't find it since GetRequestCookie()
actually looks up Mod::<modname>::<cookie name>.

The fix is to look up the global cookie name if the mod one doesnt exist.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1861 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-03-30 19:49:51 +00:00
parent ff4c3f4f03
commit 039d95073e

View File

@@ -478,11 +478,16 @@ bool CWebSock::ForceLogin() {
}
CString CWebSock::GetRequestCookie(const CString& sKey) const {
CString sRet;
if (!m_sModName.empty()) {
return CHTTPSock::GetRequestCookie("Mod::" + m_sModName + "::" + sKey);
sRet = CHTTPSock::GetRequestCookie("Mod::" + m_sModName + "::" + sKey);
}
return CHTTPSock::GetRequestCookie(sKey);
if (sRet.empty()) {
return CHTTPSock::GetRequestCookie(sKey);
}
return sRet;
}
bool CWebSock::SendCookie(const CString& sKey, const CString& sValue) {