title: j2ee session migration and session replication
body: <p>From the book <code>Head First Servlets and JSP, Second Edition</code> <a href="http://my.safaribooksonline.com/book/web-development/jsp/9780596516680/session-management-conversational-state/session_migration" rel="nofollow">P257</a></p>
  
  <p>the author said:</p>
  
  <blockquote>
    <p>But there is only one HttpSession object for a given session ID per
    web app, regardless of how many VM’s the app is distributed across.</p>
  </blockquote>
  
  <p>however from tomcat documentation: <a href="http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html" rel="nofollow">Clustering/Session Replication HOW-TO</a>
  it does say sessions can be replicated in multiple vms:</p>
  
  <blockquote>
    <p>The cluster is started and will establish a membership
    (TomcatA,TomcatB). TomcatB will now request the session state from a
    server that already exists in the cluster, in this case TomcatA.
    TomcatA responds to the request, and before TomcatB starts listening
    for HTTP requests, the state has been transferred from TomcatA to
    TomcatB.</p>
  </blockquote>
  
  <p>I don't know how to understand this.</p>