oopss. forgot to save before last comit
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 10 Jan 2008 11:50:08 +0000 (11:50 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 10 Jan 2008 11:50:08 +0000 (11:50 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2542 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/session/IdPSessionFilter.java

index bace811..0f12350 100644 (file)
@@ -53,16 +53,18 @@ public class IdPSessionFilter implements Filter {
             ServletException {
         HttpServletRequest httpRequest = (HttpServletRequest) request;
         HttpServletResponse httpResponse = (HttpServletResponse) response;
             ServletException {
         HttpServletRequest httpRequest = (HttpServletRequest) request;
         HttpServletResponse httpResponse = (HttpServletResponse) response;
-
+        
+        Session idpSession = null;
         Cookie idpSessionCookie = getIdPSessionCookie(httpRequest);
         if (idpSessionCookie != null) {
         Cookie idpSessionCookie = getIdPSessionCookie(httpRequest);
         if (idpSessionCookie != null) {
-            Session idpSession = sessionManager.getSession(idpSessionCookie.getValue());
+             idpSession = sessionManager.getSession(idpSessionCookie.getValue());
             if (idpSession != null) {
                 idpSession.setLastActivityInstant(new DateTime());
                 httpRequest.setAttribute(Session.HTTP_SESSION_BINDING_ATTRIBUTE, idpSession);
             if (idpSession != null) {
                 idpSession.setLastActivityInstant(new DateTime());
                 httpRequest.setAttribute(Session.HTTP_SESSION_BINDING_ATTRIBUTE, idpSession);
-                addIdPSessionCookieToResponse(httpRequest, httpResponse, idpSession);
             }
         }
             }
         }
+        
+        addIdPSessionCookieToResponse(httpRequest, httpResponse, idpSession);
 
         filterChain.doFilter(request, response);
     }
 
         filterChain.doFilter(request, response);
     }
@@ -103,7 +105,7 @@ public class IdPSessionFilter implements Filter {
      * @param userSession user's currentSession
      */
     protected void addIdPSessionCookieToResponse(HttpServletRequest request, HttpServletResponse response,
      * @param userSession user's currentSession
      */
     protected void addIdPSessionCookieToResponse(HttpServletRequest request, HttpServletResponse response,
-            Session userSession) {
+            Session userSession) {        
         Cookie sessionCookie = new Cookie(IDP_SESSION_COOKIE_NAME, userSession.getSessionID());
         sessionCookie.setDomain(request.getLocalName());
         sessionCookie.setPath(request.getContextPath());
         Cookie sessionCookie = new Cookie(IDP_SESSION_COOKIE_NAME, userSession.getSessionID());
         sessionCookie.setDomain(request.getLocalName());
         sessionCookie.setPath(request.getContextPath());