Sets the 1st bit of the connect flags

@param bool $cleanSession
@return Parameters
761386
public function setCleanSession(bool $cleanSession): self
    {
        $this->bitFlag &= ~2;
        if ($cleanSession === true) {
            $this->logger->debug('Clean session flag set');
            $this->bitFlag |= 2;
        }
        $this->cleanSession = $cleanSession;
        return $this;
    }
906106
public function regenerateID($deleteOldSession=false)
	{
		$oldID=session_id();

		// if no session is started, there is nothing to regenerate
		if(empty($oldID))
			return;

		parent::regenerateID(false);
		$newID=session_id();
		$db=$this->getDbConnection();

		$row=$db->createCommand()
			->select()
			->from($this->sessionTableName)
			->where('id=:id',array(':id'=>$oldID))
			->queryRow();
		if($row!==false)
		{
			if($deleteOldSession)
				$db->createCommand()->update($this->sessionTableName,array(
					'id'=>$newID
				),'id=:oldID',array(':oldID'=>$oldID));
			else
			{
				$row['id']=$newID;
				$db->createCommand()->insert($this->sessionTableName, $row);
			}
		}
		else
		{
			// shouldn't reach here normally
			$db->createCommand()->insert($this->sessionTableName, array(
				'id'=>$newID,
				'expire'=>time()+$this->getTimeout(),
				'data'=>'',
			));
		}
	}
1149197
public function setFlags($flags) {
        if($flags !== $flags & (AMQP_DURABLE | AMQP_PASSIVE | AMQP_EXCLUSIVE | AMQP_AUTODELETE))
            return false;

        $this->flags = $flags;
        return true;
    }
1131100
private function unlockSession()
    {
        if ($this->redis instanceof \Redis) {
            // If we have the right token, then delete the lock
            $script = <<<LUA
            if redis.call("GET", KEYS[1]) == ARGV[1] then
                return redis.call("DEL", KEYS[1])
            else
                return 0
            end
LUA;

            $token = $this->redis->_serialize($this->token);
            $this->redis->eval($script, array($this->lockKey, $token), 1);
        } else {
            $this->redis->getProfile()->defineCommand('sncFreeSessionLock', FreeLockCommand::class);
            $this->redis->sncFreeSessionLock($this->lockKey, $this->token);
        }
        $this->locked = false;
        $this->token = null;
    }
588381
public static function GetInstance($bReset = false, $bReloadFromSession = false)
    {
        /** @var $shopService ShopServiceInterface */
        $shopService = \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_shop.shop_service');
        if ($bReset) {
            $shopService->resetBasket();
        }

        return $shopService->getActiveBasket();
    }
232827
public function setFlags( $flags ) {
		$add = [];
		$remove = [];
		$classPrefix = 'oo-ui-flaggedElement-';

		if ( is_string( $flags ) ) {
			// Set
			if ( !isset( $this->flags[$flags] ) ) {
				$this->flags[$flags] = true;
				$add[] = $classPrefix . $flags;
			}
		} elseif ( is_array( $flags ) ) {
			foreach ( $flags as $key => $value ) {
				if ( is_numeric( $key ) ) {
					// Set
					if ( !isset( $this->flags[$value] ) ) {
						$this->flags[$value] = true;
						$add[] = $classPrefix . $value;
					}
				} else {
					if ( $value ) {
						// Set
						if ( !isset( $this->flags[$key] ) ) {
							$this->flags[$key] = true;
							$add[] = $classPrefix . $key;
						}
					} else {
						// Remove
						if ( isset( $this->flags[$key] ) ) {
							unset( $this->flags[$key] );
							$remove[] = $classPrefix . $key;
						}
					}
				}
			}
		}

		$this->flagged
			->addClasses( $add )
			->removeClasses( $remove );

		return $this;
	}
1195530
protected function setConnectionOptions() {
        $options = $this->sessionVars;
        //$options['time_zone'] = date_default_timezone_get();      // synchronize connection timezone with PHP timezone

        foreach ($options as $option => $value) {
            if (strlen($value)) {
                $this->execute('set '.$option.' to '.$value);       // as is (no quoting)
            }
        }
        return $this;
    }
1159760
public function clear(): SessionInterface
    {
        # Get all the current session data
        $values = $this->getAll();

        # Replace all the values with nulls
        $values = array_map(function ($value) {
            return null;
        }, $values);

        # Store all the null values (effectively unsetting the keys)
        $this->set($values);

        return $this;
    }
829997
public function setNativeSession($useNativeSession = FALSE)
    {
        $this->nativeSession = $useNativeSession;
        $this->debug->debug(__FUNCTION__, 'setNativeSession: ' . json_encode($this->nativeSession));

        return $this;
    }
441697
protected static function _cleanPrevious()
		{
			if(self::$_cleanedPrev) return true;
			self::$_cleanedPrev = 1;

			if(isset($_SESSION) && is_array($_SESSION)) {
                foreach ($_SESSION as $key => $value) {
                    if (strpos($key, self::$_sessionKey) === 0) {
                        if ($_SESSION[$key][0] < 1) {
                            unset($_SESSION[$key]);
                        } else {
                            $_SESSION[$key][0] = 0;
                        }
                    }
                }
            }
		}
687436
public function transactionStart($transactionMode = false, $sessionCharacteristics = false)
    {
        if ($this->transactionNesting <= 0) {
            $this->transactionNesting = 1;
            $this->child->transactionStart($transactionMode, $sessionCharacteristics);
        } else {
            if ($this->child->supportsSavepoints()) {
                $this->child->transactionSavepoint("nesting" . $this->transactionNesting);
            }
            $this->transactionNesting++;
        }
    }
1193101
public static function init($reset = false)
    {
        if (!static::$namespaces || $reset) {
            $namespaces = new \SplPriorityQueue();

            $namespaces->insert(static::$defaultNamespace, $reset);

            static::$namespaces = $namespaces;
        }
    }
1171914
private function deleteOldSessions()
    {
        // 2% chance of kicking idle sessions
        if (mt_rand(0, 49)) {
            return false;
        }

        $sessions = new UsersSessionEntityRepository();
        $sessions->setOnlyOutdated();
        $sessions->deleteObjectCollection();

        return true;
    }
938342
public function setSessionIndex($sessionIndex)
    {
        $this->sessionIndex = $sessionIndex;

        unset($_SESSION[self::class][$this->getConfig()->getEntityID()]['session_index']);
        $_SESSION[self::class][$this->getConfig()->getEntityID()]['session_index'] = $sessionIndex;

        return $this;
    }
229206
private function setOrAddSession(Request $request)
    {
        $containerName = $request->getPost('containerName', 'Default');
        $keysession = $request->getPost('keysession', '');
        $sessionValue = $request->getPost('sessionvalue', '');
        $new = (bool) $request->getPost('new', false);

        $notEmptyValidator = new NotEmpty();
        if ($notEmptyValidator->isValid($keysession) && $notEmptyValidator->isValid($sessionValue)) {
            $success = $this->sessionManager
                            ->sessionSetting($containerName, $keysession, $sessionValue, ['set' => true, 'new' => $new]);

            return ['success' => $success, 'errorMessage' => ''];
        }

        return ['success' => false, 'errorMessage' => 'Value is required and can\'t be empty'];
    }
569349
protected function _initNewSessionChallenge()
    {
        $this->setVariable('sess_stoken', sprintf('%X', crc32(\OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID())));
    }
6671
public function setFlags($flags)
    {
        $flags = Utility::ParseFlags($flags);

        $this->setDup($flags['dup']);
        $this->setQos($flags['qos']);
        $this->setRetain($flags['retain']);
        return true;
    }