public function sessionOnlyReusesTheSessionIdFromIncomingCookies()
{
$metaDataCache = $this->createCache('Meta');
$storageCache = $this->createCache('Storage');
$session = new Session();
$this->inject($session, 'bootstrap', $this->mockBootstrap);
$this->inject($session, 'objectManager', $this->mockObjectManager);
$this->inject($session, 'settings', $this->settings);
$this->inject($session, 'metaDataCache', $metaDataCache);
$this->inject($session, 'storageCache', $storageCache);
$session->initializeObject();
$session->start();
$session->putData('foo', 'bar');
$sessionIdentifier = $session->getId();
$session->close();
$requestCookie = new Http\Cookie($this->settings['session']['name'], $sessionIdentifier, 0, 100, 'other', '/');
$this->httpRequest->setCookie($requestCookie);
$session = new Session();
$this->inject($session, 'bootstrap', $this->mockBootstrap);
$this->inject($session, 'objectManager', $this->mockObjectManager);
$this->inject($session, 'settings', $this->settings);
$this->inject($session, 'metaDataCache', $metaDataCache);
$this->inject($session, 'storageCache', $storageCache);
$session->initializeObject();
$session->resume();
$responseCookie = $this->httpResponse->getCookie($this->settings['session']['name']);
$this->assertNotEquals($requestCookie, $responseCookie);
$this->assertEquals($requestCookie->getValue(), $responseCookie->getValue());
}