Save the modification about sessions items
@return bool true if iumio session is the same as PHP SESSION, false for an error
($_SESSION & $this->session not the same)
762632
public function save():bool
    {
        $_SESSION = $this->session;
        return (0 === count(array_diff($this->session, $_SESSION)))? true : false;
    }
769747
public function save()
    {
        $appname = $this->name;
        $temp = "no";
        $temdirbase = FEnv::get("framework.root").
            "vendor/iumio-framework/Core/Additional/Manager/Module/App/AppTemplate";
        $tempdir = ($temp == "no")? $temdirbase.'/notemplate/{appname}/' : $temdirbase.'/template/{appname}/';
        Server::copy($tempdir, FEnv::get("framework.root")."apps/".$appname, 'directory');
        $napp = FEnv::get("framework.root")."apps/".$appname;

        // APP
        $f = file_get_contents($napp."/{appname}.php.local");
        $str = str_replace("{appname}", $appname, $f);
        file_put_contents($napp."/{appname}.php.local", $str);
        rename($napp."/{appname}.php.local", $napp."/$appname.php");

        // Mercure
        $f = file_get_contents($napp."/Routing/default.merc");
        $str = str_replace("{appname}", $appname, $f);
        file_put_contents($napp."/Routing/default.merc", $str);

        // MASTER
        $f = file_get_contents($napp."/Masters/DefaultMaster.php.local");
        $str = str_replace("{appname}", $appname, $f);
        file_put_contents($napp."/Masters/DefaultMaster.php.local", $str);
        rename($napp."/Masters/DefaultMaster.php.local", $napp."/Masters/DefaultMaster.php");

        // REGISTER TO APP CORE
        $f = json_decode(file_get_contents(FEnv::get("framework.root").
            "elements/config_files/core/apps.json"));
        $lastapp = 0;
        foreach ($f as $one => $val) {
            $lastapp++;
        }
        if ($this->params['isdefault'] == "yes") {
            foreach ($f as $one => $val) {
                if ($val->isdefault == "yes") {
                    $val->isdefault = "no";
                    break;
                }
            }
        }
        $f->$lastapp = new \stdClass();
        $f->$lastapp->name = $this->params['appname'];
        $f->$lastapp->isdefault = $this->params['isdefault'];
        $f->$lastapp->class = "\\".$this->params['appname']."\\".$this->params['appname'];
        $f = json_encode($f, JSON_PRETTY_PRINT);
        file_put_contents(FEnv::get("framework.root")."elements/config_files/core/apps.json", $f);
        if ($this->params['template'] == "yes") {
            new AM(array("core/manager", "assets-manager", "--copy", "--appname=". $this->params['appname'],
                "--symlink", "--noexit"));
        }
        Output::outputAsSuccess("\n Your app is ready to use. To test your app go to project location on your
         browser with parameter /hello. Enjoy ! \n", "none");
    }
360795
public function save()
    {
        $this->session['last_activity'] = time();

        // age it that should expire at the end of the user's next request.
        $this->age();

        $sessionConf = Config::get('session');

        // save data into the specialized storage.
        $this->storage->save($this->session, $sessionConf, $this->exists);

        // determine the owner of the session
        // on the user's subsequent requests to the application.
        $this->cookie($sessionConf);

        // calculate and run garbage collection cleaning.
        $cleaning = $sessionConf['garbage_collection'];

        if (mt_rand(1, $cleaning[1]) <= $cleaning[0]) {
            $this->clean();
        }
    }
1123380
public static function sessionExists()
    {
        if (ini_get('session.use_cookies') == '1' && isset($_COOKIE[session_name()])) {
            return true;
        } elseif (!empty($_REQUEST[session_name()])) {
            return true;
        } elseif (self::$_unitTestEnabled) {
            return true;
        }

        return false;
    }
248660
public function save()
    {
        $result = true;

        if (!empty($this->changedData)) {
            foreach ($this->changedData as $scope => $rowData) {
                foreach ($rowData as $layoutName => $layoutData) {
                    if (empty($scope) || empty($layoutName)) {
                        continue;
                    }
                    $layoutPath = $this->getLayoutPath($scope, true);
                    $data = Json::encode($layoutData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);

                    $result &= $this->getFileManager()->putContents(array($layoutPath, $layoutName.'.json'), $data);
                }
            }
        }

        if ($result == true) {
            $this->clearChanges();
        }

        return (bool) $result;
    }
771590
public function isModified()
    {
        if ($this->read_only) {
            return false;
        }

        foreach ($this->getProperties() as $name => $value) {
            $hashed_value = $this->getHashValue($value);
            if (
                isset($this->property_hashes[$name]) &&
                $hashed_value !== $this->property_hashes[$name]
            ) {
                return true;
            }
        }

        foreach ($this->internal_property_autosave as $name => $autosave) {
            if ($autosave && isset($this->sub_data_objects[$name])) {
                $object = $this->sub_data_objects[$name];
                if (
                    $object instanceof SwatDBRecordable &&
                    $object->isModified()
                ) {
                    return true;
                }
            }
        }

        foreach ($this->sub_data_objects as $name => $object) {
            $saver_method =
                'save' . str_replace(' ', '', ucwords(strtr($name, '_', ' ')));

            if (method_exists($this, $saver_method)) {
                $object = $this->sub_data_objects[$name];
                if (
                    $object instanceof SwatDBRecordable &&
                    $object->isModified()
                ) {
                    return true;
                }
            }
        }

        return false;
    }
1155572
protected function saveToSession()
    {
        if ($this->session !== null) {
            $this->session->set(self::SESSION_ID, $this->loginData);
        }
    }
339911
public function & SaveSession () {
		/** @var $this \MvcCore\Ext\Forms\IForm */
		$session = & $this->getSession();
		$session->errors = $this->errors;
		$session->values = $this->values;
		return $this;
	}
570911
public function saveSnippets() {
    // Save the altered snippets after hook_google_tag_snippets_alter().
    module_load_include('inc', 'google_tag', 'includes/snippet');
    $result = TRUE;
    $snippets = google_tag_snippets();
    foreach ($snippets as $type => $snippet) {
      $path = file_unmanaged_save_data($snippet, "public://js/google_tag.$type.js", FILE_EXISTS_REPLACE);
      $result = !$path ? FALSE : $result;
    }
    if (!$result) {
      drupal_set_message(t('An error occurred saving one or more snippet files. Please try again or contact the site administrator if it persists.'));
    }
    else {
      drupal_set_message(t('Created three snippet files based on configuration.'));
      $this->collectionOptimizer->deleteAll();
      _drupal_flush_css_js();
    }
    return TRUE;
  }
472491
private function storeUserSession($session)
    {
        // get all sessions
        $sessions = $this->getMeta()->sessions->val();
        if (!is_array($sessions)) {
            $sessions = [];
        }

        // delete the old sessions
        $newSessions = [];
        $ttl = $this->getSessionTtl();
        foreach ($sessions as $s) {
            if (($s['created'] + $ttl) > time()) {
                $newSessions[] = $s;
            }
        }

        // append the new session
        $newSessions[] = ['sid' => $session, 'created' => time(), 'ip' => $this->ip];

        // update the last login date
        $this->getMeta()->lastLogin = time();

        // append a new login attempt
        $this->getMeta()->loginAttempts[] = ['ip' => $this->ip, 'timestamp' => time()];

        // update the entity
        $this->getMeta()->sessions = $newSessions;
        $this->getMeta()->save();
    }
494090
public function save()
    {
        if ($this->validate()) {
            $manager = Configs::authManager();
            if ($this->_item === null) {
                if ($this->type == Item::TYPE_ROLE) {
                    $this->_item = $manager->createRole($this->name);
                } else {
                    $this->_item = $manager->createPermission($this->name);
                }
                $isNew = true;
            } else {
                $isNew = false;
                $oldName = $this->_item->name;
            }
            $this->_item->name = $this->name;
            $this->_item->description = $this->description;
            $this->_item->ruleName = $this->ruleName;
            $this->_item->data = $this->data === null || $this->data === '' ? null : Json::decode($this->data);
            if ($isNew) {
                $manager->add($this->_item);
            } else {
                $manager->update($oldName, $this->_item);
            }
            Helper::invalidate();
            return true;
        } else {
            return false;
        }
    }
1261922
protected function saveInternal()
    {
        $modified_properties = $this->getModifiedProperties();

        if (count($modified_properties) === 0) {
            return;
        }

        if ($this->table === null) {
            trigger_error(
                sprintf('No table defined for %s', get_class($this)),
                E_USER_NOTICE
            );

            return;
        }

        if ($this->id_field === null) {
            if (!$this->loaded_from_database) {
                $this->saveNewBinding();
                return;
            }

            trigger_error(
                sprintf('No id_field defined for %s', get_class($this)),
                E_USER_NOTICE
            );

            return;
        }

        $id_field = new SwatDBField($this->id_field, 'integer');

        if (!property_exists($this, $id_field->name)) {
            trigger_error(
                sprintf(
                    "The id_field '%s' is not defined for %s",
                    $id_field->name,
                    get_class($this)
                ),
                E_USER_NOTICE
            );

            return;
        }

        $id_ref = $id_field->name;
        $id = $this->$id_ref;

        $fields = array();
        $values = array();

        foreach ($modified_properties as $name => $value) {
            if ($name === $id_field->name) {
                continue;
            }

            $type = $this->guessType($name, $value);

            if ($type == 'date') {
                $value = $value->getDate();
            }

            $fields[] = sprintf('%s:%s', $type, $name);
            $values[$name] = $value;
        }

        if ($id === null) {
            $this->$id_ref = SwatDB::insertRow(
                $this->db,
                $this->table,
                $fields,
                $values,
                $id_field->__toString()
            );
        } else {
            SwatDB::updateRow(
                $this->db,
                $this->table,
                $fields,
                $values,
                $id_field->__toString(),
                $id
            );
        }

        // Note: This flushes any name-spaces with the newly saved
        // data-object data. In theory you may need to flush name-spaces
        // that rely on the pre-changed values. You must handle this case
        // manually in your application's code by cloning the object
        // before setting the values.
        $this->flushCacheNamespaces();
    }
380224
public function modify()
    {
        $updLastModStm = $this->connection->prepare("UPDATE Page SET last_modified=FROM_UNIXTIME(?) WHERE page_id=?");
        $updLastModStm->bindParam(1, $this->lastModified);
        $updLastModStm->bindParam(2, $this->page_id);
        $this->lastModified = time();
        $updLastModStm->execute();
        return $this->lastModified;

    }
578504
public function save()
    {
        $id = $this->search(0)->getValue();
        $passCheck = $this->search("format", "passwordRequired");
        if ($passCheck) {
            $d = new Dicionario("usuarios");
            $columnPass = $d->search($d->getInfo()['password'])->getColumn();
        }
        if (!$passCheck || $passCheck->getValue() === $_SESSION['userlogin'][$columnPass]) {

            $this->checkDataToSave($id);

            $dadosEntity = $this->getDataOnlyEntity();
            $dadosEntity = $this->createUpdateUser($this->entity, $dadosEntity, (!empty($id) ? "update" : "create"));

            if (!$this->getError()) {

                if (!empty($id))
                    $data = $this->updateTableData($id, $dadosEntity);
                elseif (!$this->getError())
                    $data = $this->createTableData($dadosEntity);

                if (!$this->getError() || !empty($id)) {

                    $dadosEntity['id'] = (int) $this->search(0)->getValue();

                    if (!empty($data['error'])) {
                        if (is_array($data['error'])) {
                            foreach ($data['error'] as $column => $err) {
                                if (is_string($column) && is_string($err) && $meta = $this->search($column)) {
                                    $meta->setError($err);
                                }
                            }
                        } else {
                            $this->search(0)->setError($data['error']);
                        }
                    } else {
                        $this->setData($this->search(0)->getValue());
                    }
                }
            }
        } else {
            $passCheck->setError("Senha Inválida");
        }
    }
464061
private function setSaveHandler() {

		if (PHP_VERSION_ID >= 50400) {

			$this->storageEngine = new NativeSessionWrapper();

			if(!session_set_save_handler($this->storageEngine, FALSE)) {
				throw new \RuntimeException('Could not  set session save handler.');
			}

		}

	}
961239
public function setSaveHandler()
    {
        $ini = eZINI::instance();
        if ( $ini->hasVariable('Session', 'SessionTimeout') && $ini->variable('Session', 'SessionTimeout') )
        {
            ini_set("session.gc_maxlifetime", $ini->variable('Session', 'SessionTimeout') );
        }
        // make sure eZUser does not update lastVisit on every request and only on login
        $GLOBALS['eZSessionIdleTime'] = 0;
        return true;
    }
1011487
public function beforeSave()
    {
        if ('' !== $password = $this->getElement('changePassword')->getValue()) {
            $this->getRecord()->password = \Cms\Model\Auth::getSaltedPasswordHash($password);
        }
        return true;
    }