path is now explicitly set to '/' when setting JSESSIONID (#301)

This commit is contained in:
Philip Woods 2019-11-27 17:15:27 -08:00 committed by An Tao
parent 40ffb2d2af
commit 0fa61cded3
1 changed files with 6 additions and 2 deletions

View File

@ -564,14 +564,18 @@ void HttpAppFrameworkImpl::callCallback(
auto newResp = std::make_shared<HttpResponseImpl>(
*static_cast<HttpResponseImpl *>(resp.get()));
newResp->setExpiredTime(-1); // make it temporary
newResp->addCookie("JSESSIONID", sessionPtr->sessionId());
auto jsessionid = Cookie("JSESSIONID", sessionPtr->sessionId());
jsessionid.setPath("/");
newResp->addCookie(std::move(jsessionid));
sessionPtr->hasSet();
callback(newResp);
return;
}
else
{
resp->addCookie("JSESSIONID", sessionPtr->sessionId());
auto jsessionid = Cookie("JSESSIONID", sessionPtr->sessionId());
jsessionid.setPath("/");
resp->addCookie(std::move(jsessionid));
sessionPtr->hasSet();
callback(resp);
return;