Fix SIDP-199
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 15 Jun 2008 08:15:16 +0000 (08:15 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 15 Jun 2008 08:15:16 +0000 (08:15 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/branches/REL_2@2737 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/main/java/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java

index 31e9c09..ddb8d71 100644 (file)
@@ -499,7 +499,14 @@ public class AuthenticationEngine extends HttpServlet {
 
         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);