diff --git a/lib/src/HttpAppFrameworkImpl.cc b/lib/src/HttpAppFrameworkImpl.cc index a66c2b4a..b14b794e 100644 --- a/lib/src/HttpAppFrameworkImpl.cc +++ b/lib/src/HttpAppFrameworkImpl.cc @@ -564,14 +564,18 @@ void HttpAppFrameworkImpl::callCallback( auto newResp = std::make_shared( *static_cast(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;