git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/branches/REL_2@2737
ab3bd59b-922f-494d-bb5f-
6f0a3c29deca
LOG.debug("Adding IdP session cookie to HTTP response");
Cookie sessionCookie = new Cookie(IDP_SESSION_COOKIE_NAME, userSession.getSessionID());
- sessionCookie.setPath(httpRequest.getContextPath());
+
+ String contextPath = httpRequest.getContextPath();
+ if(DatatypeHelper.isEmpty(contextPath)){
+ sessionCookie.setPath("/");
+ }else{
+ sessionCookie.setPath(contextPath);
+ }
+
sessionCookie.setSecure(false);
sessionCookie.setMaxAge(-1);