Prepares the appropriate session for the release of Drupal being upgraded.
protected function prepareD8Session() {
// Generate and set a D7-compatible session cookie.
$this
->curlInitialize();
$sid = drupal_hash_base64(uniqid(mt_rand(), TRUE) . drupal_random_bytes(55));
curl_setopt($this->curlHandle, CURLOPT_COOKIE, rawurlencode(session_name()) . '=' . rawurlencode($sid));
// Force our way into the session of the child site.
drupal_save_session(TRUE);
_drupal_session_write($sid, '');
drupal_save_session(FALSE);
}