/** * Renew session id and update session cookie * * @return $this */ public function regenerateId() { if (headers_sent()) { return $this; } if ($this->isSessionExists()) { session_regenerate_id(true); } else { session_start(); } $this->storage->init(isset($_SESSION) ? $_SESSION : []); if ($this->sessionConfig->getUseCookies()) { $this->clearSubDomainSessionCookie(); } return $this; }
/** * Unset all session data * * @return $this */ public function clearStorage() { $this->storage->unsetData(); return $this; }
public function testSetQuoteId() { $quoteId = 1; $this->storageMock->expects($this->once())->method('setQuoteId')->with($quoteId); $this->assertInstanceOf('Magento\\Authorizenet\\Model\\Directpost\\Session', $this->session->setQuoteId($quoteId)); }