Save value to session
518063
def save_value(self, name, value):
        """"""
        session_name = 'list_{}_{}_{}'.format(self.kwargs.get('app'), self.kwargs.get('model'), name)
        self.request.session[session_name] = value
        setattr(self, name, value)
        return value
707459
function save(storage, name, value) {
        var key = '$BD$' + name;
        if (value === null) value = '';
        storage[key] = value;
      }
1208446
public function save()
    {
        $json = [];
        foreach ($this as $cookie) {
            if ($cookie->getExpires() && !$cookie->getDiscard()) {
                $json[] = $cookie->toArray();
            }
        }

        $_SESSION[$this->sessionKey] = json_encode($json);
    }
1155572
protected function saveToSession()
    {
        if ($this->session !== null) {
            $this->session->set(self::SESSION_ID, $this->loginData);
        }
    }
1322712
public void saveProperty(DbSession session, PropertyDto property) {
    save(getMapper(session), property.getKey(), property.getUserId(), property.getResourceId(), property.getValue());
  }
53528
public function save($key, $value)
    {
        $this->sessionBag->removeKey($key)->append($key, $value);
        $_SESSION[$key] = $value;

        return $this;
    }
752784
def store_value(self, name, value):
        """"""
        self.spine.send_command("storeSetting", self.group, name, value)
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();
        }
    }
151967
def in_session(self):
        """"""
        session = self.get_session()
        try:
            yield session
            session.commit()
        except IntegrityError:
            session.rollback()
            raise DuplicateError("Duplicate unique value detected!")
        except (OperationalError, DisconnectionError):
            session.rollback()
            self.close()
            logger.warn("Database Connection Lost!")
            raise DatabaseConnectionError()
        except Exception:
            session.rollback()
            raise
        finally:
            session.close()
904215
public void save(HttpSession httpSession) {
		String sessionSerialized = serializeSession();
		// Finally store the maestrano session
		httpSession.setAttribute(MAESTRANO_SESSION_ID, sessionSerialized);
	}
662473
function saveSession(path, session, controller, req, sessions) {
    let request = controller.__request;
    controller.__request = null;

    let time = process.hrtime();

    let ourObjectTemplate = getObjectTemplate(controller);

    let serialSession;

    if (typeof(ourObjectTemplate.serializeAndGarbageCollect) === 'function') {
        serialSession = ourObjectTemplate.serializeAndGarbageCollect();
    }
    else {
        serialSession = controller.toJSONString();
    }

    // Track the time of the last serialization to make sure it is valid
    let sessionData = getSessionCache(path, ourObjectTemplate.controller.__sessionId, true, sessions);
    sessionData.serializationTimeStamp = (new Date ()).getTime();

    session.semotus.controllers[path] = {controller: compressSessionData(serialSession),
        serializationTimeStamp: sessionData.serializationTimeStamp};

    session.semotus.lastAccess = new Date(); // Tickle it to force out cookie

    if (ourObjectTemplate.objectMap) {
        if (!session.semotus.objectMap) {
            session.semotus.objectMap = {};
        }

        session.semotus.objectMap[path] = ourObjectTemplate.objectMap;
    }

    req.amorphicTracking.addServerTask(
        {
            name: 'Save Session',
            size: session.semotus.controllers[path].controller.length
        },
        time);

    controller.__request = request;
}
139246
public function saveState()
	{
        if($this->sessionEnabled()) {
            // Session handling.
            if(!is_array($this->sessionvars)) {
                $this->sessionvars = array();
            }
            foreach($this->sessionvars as $varname => $val) {
                if($val === null) {
                    unset($_SESSION[$varname]);
                }
                else {
                    $_SESSION[$varname] = $val;
                }
            }
        }

        if(!headers_sent()) {
            foreach($this->cookievars as $cookiename => $cookiedef) {
                if($cookiedef['value'] === null) {
                    setcookie($cookiename, null, time() - 3600, '/'); // Expiring the cookie
                }
                else {
                    setcookie(
                        $cookiename,
                        $cookiedef['value'],
                        time() + $cookiedef['max_age'],
                        '/'
                    );
                }
            }
        }
	}
271768
def save(self, must_create=False):
        
        obj = Session(
            session_key=self._get_or_create_session_key(),
            session_data=self.encode(self._get_session(no_load=must_create)),
            expire_date=self.get_expiry_date(),
            user_agent=self.user_agent,
            user_id=self.user_id,
            ip=self.ip,
        )
        using = router.db_for_write(Session, instance=obj)
        try:
            with transaction.atomic(using):
                obj.save(force_insert=must_create, using=using)
        except IntegrityError as e:
            if must_create and 'session_key' in str(e):
                raise CreateError
            raise
882570
function SessionStorage_setValue(key, value) {
        var nKey = this.config.key_prefix + key,
            tKey = nKey + '_TIME';

        // if has key refresh it
        if (this.config.storage.has(nKey)) {
            // remove key
            this.config.storage.remove(nKey);
            // clear old timeout to avoid memory leak
            if (this.timeouts.hasOwnProperty(tKey) ) {
                clearTimeout(this.timeouts[tKey]);
                // remove old time key
                delete this.timeouts[tKey];
            }
        }
        // set new value
        this.config.storage.set(nKey, value, this.getExpiredTime());
        // set clear timeout
        // set id value
        this.timeouts[tKey] = setTimeout(function ()  {
            this.config.storage.remove(nKey);
            this.config.storage.remove(tKey);
        }.bind(this), this.getExpiredTime());
    }
1105240
async def save_session(self, session: Session, response: Response) -> None:
        """"""
        await ensure_coroutine(self.session_interface.save_session)(self, session, response)
456507
async def save_session(self, sid, session):
        
        socket = self._get_socket(sid)
        socket.session = session
1245328
def save_session_to_file(self, sessionfile):
        """"""
        pickle.dump(requests.utils.dict_from_cookiejar(self._session.cookies), sessionfile)