code: public String changeSessionIdOnTomcatFailover( final String requestedSessionId ) {
          if ( !_sticky ) {
              return null;
          }
          final String localJvmRoute = _manager.getJvmRoute();
          if ( localJvmRoute != null && !localJvmRoute.equals( getSessionIdFormat().extractJvmRoute( requestedSessionId ) ) ) {
  
              // the session might already be relocated, e.g. if some ajax calls are running concurrently.
              // if we'd run session takeover again, a new empty session would be created.
              // see https://github.com/magro/memcached-session-manager/issues/282
              final String newSessionId = _memcachedNodesManager.changeSessionIdForTomcatFailover(requestedSessionId, _manager.getJvmRoute());
              if (_manager.getSessionInternal(newSessionId) != null) {
                  return newSessionId;
              }
  
              // the session might have been loaded already (by some valve), so let's check our session map
              MemcachedBackupSession session = _manager.getSessionInternal( requestedSessionId );
              if ( session == null ) {
                  session = loadFromMemcachedWithCheck( requestedSessionId );
              }
  
              // checking valid() can expire() the session!
              if ( session != null && session.isValid() ) {
                  return handleSessionTakeOver( session );
              } else if (_manager.getSessionInternal(newSessionId) != null) {
                  return newSessionId;
              }
          }
          return null;
      }
docs: Check if the given session id does not belong to this tomcat (according to the
  local jvmRoute and the jvmRoute in the session id). If the session contains a
  different jvmRoute load if from memcached. If the session was found in memcached and
  if it's valid it must be associated with this tomcat and therefore the session id has to
  be changed. The new session id must be returned if it was changed.
  <p>
  This is only useful for sticky sessions, in non-sticky operation mode <code>null</code> should
  always be returned.
  </p>
  
  @param requestedSessionId
  the sessionId that was requested.
  
  @return the new session id if the session is taken over and the id was changed.
  Otherwise <code>null</code>.
  
  @see Request#getRequestedSessionId()