From 0fa61cded3524bf357e575e36cbd80a75e8bc560 Mon Sep 17 00:00:00 2001 From: Philip Woods Date: Wed, 27 Nov 2019 17:15:27 -0800 Subject: [PATCH] path is now explicitly set to '/' when setting JSESSIONID (#301) --- lib/src/HttpAppFrameworkImpl.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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;