SidCookieFix/copy_this/modules/d3/sidcookiefix/modules/core/d3_sidcookiefix_oxsession.php

50 lignes
1.5 KiB
PHP

<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright © D³ Data Development, Thomas Dartsch
* @author D³ Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_sidcookiefix_oxsession extends d3_sidcookiefix_oxsession_parent
{
protected function _setSessionId($sSessId)
{
//marking this session as new one, as it might be not writen to db yet
if ($sSessId && session_id() != $sSessId) {
$this->_blNewSession = true;
}
session_id($sSessId);
$this->setId($sSessId);
$blUseCookies = $this->_getSessionUseCookies();
if (!$this->_allowSessionStart()) {
if ($blUseCookies) {
oxRegistry::get("oxUtilsServer")->setOxCookie($this->getName(), null);
}
return;
}
if ($blUseCookies) {
// D3: check for set SessionCookie
$sCookieSessid = oxRegistry::get("oxUtilsServer")->getOxCookie($this->getName());
if (!$sCookieSessid || $sSessId != $sCookieSessid) {
//setting session cookie
oxRegistry::get("oxUtilsServer")->setOxCookie($this->getName(), $sSessId);
}
}
}
}