SidCookieFix/modules/core/Session_sidcookiefix.php

35 lines
1.1 KiB
PHP

<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\SidCookieFix\modules\core;
use OxidEsales\Eshop\Core\Registry;
class Session_sidcookiefix extends Session_sidcookiefix_parent
{
protected function setSessionCookie($sessionId): void
{
if ($this->_getSessionUseCookies()) {
if (!$this->_allowSessionStart()) {
Registry::getUtilsServer()->setOxCookie($this->getName(), null);
} else {
$sCookieSessid = Registry::getUtilsServer()->getOxCookie($this->getName());
if (!$sCookieSessid || $sessionId != $sCookieSessid) {
Registry::getUtilsServer()->setOxCookie( $this->getName(), $sessionId );
}
}
}
}
}