View | Details | Raw Unified | Return to bug 40551
Collapse All | Expand All

(-)container/catalina/src/share/org/apache/catalina/session/PersistentManag (+25 lines)
Lines 25-30 Link Here
25
import java.security.PrivilegedExceptionAction;
25
import java.security.PrivilegedExceptionAction;
26
import org.apache.catalina.Container;
26
import org.apache.catalina.Container;
27
import org.apache.catalina.Context;
27
import org.apache.catalina.Context;
28
import org.apache.catalina.Engine;
28
import org.apache.catalina.Lifecycle;
29
import org.apache.catalina.Lifecycle;
29
import org.apache.catalina.LifecycleException;
30
import org.apache.catalina.LifecycleException;
30
import org.apache.catalina.LifecycleListener;
31
import org.apache.catalina.LifecycleListener;
Lines 771-776 Link Here
771
                }
772
                }
772
            } else {
773
            } else {
773
                 session = store.load(id);
774
                 session = store.load(id);
775
776
                 String jvmRoute = getJvmRoute();
777
                 if (getJvmRoute() != null && session != null) {
778
                     String requestJvmRoute = null;
779
                     int index = id.indexOf(".");
780
                     if (index > 0) {
781
                         requestJvmRoute = id
782
                                 .substring(index + 1, id.length());
783
                     }
784
                     if (requestJvmRoute != null && !requestJvmRoute.equals(jv
785
                         id = id.substring(0, index) + "." + jvmRoute;
786
                         session.setId(id);
787
                     }
788
                 }
789
774
            }
790
            }
775
        } catch (ClassNotFoundException e) {
791
        } catch (ClassNotFoundException e) {
776
            log.error(sm.getString("persistentManager.deserializeError", id, e
792
            log.error(sm.getString("persistentManager.deserializeError", id, e
Lines 801-806 Link Here
801
        return (session);
817
        return (session);
802
    }
818
    }
819
820
    /**
821
     * Retrieve the JvmRoute for the enclosing Engine.
822
     * @return the JvmRoute or null.
823
     */
824
    public String getJvmRoute() {
825
        Engine e = getEngine();
826
        return e == null ? null : e.getJvmRoute();
827
    }
803
    /**
828
    /**
(-)container/catalina/src/share/org/apache/catalina/connector/Request.java (+9 lines)
Lines 2200-2205 Link Here
2200
            if ((session != null) && !session.isValid())
2200
            if ((session != null) && !session.isValid())
2201
                session = null;
2201
                session = null;
2202
            if (session != null) {
2202
            if (session != null) {
2203
2204
              if( !requestedSessionId.equals( session.getId()))
2205
              {
2206
                Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME,
2207
                      session.getIdInternal());
2208
                configureSessionCookie(cookie);
2209
                response.addCookie(cookie);
2210
              }
2211
2203
                session.access();
2212
                session.access();
2204
                return (session);
2213
                return (session);
2205
            }
2214
            }

Return to bug 40551