/Storing An Item In The Session
10644
function(key, value, delay){
            $ExpressSESSION.session.store[key] = value;
            if(delay && is_number(delay) && delay > 0){
                var vkey = self.id()+'_'+key;
                if($ExpressSESSION.session.expires[key]) clearTimeout(sesssion_expires[vkey]);
                sesssion_expires[vkey] = setTimeout(function(){
                    self.forget(key);
                    delete sesssion_expires[vkey];
                    delete $ExpressSESSION.session.expires[key];
                }, delay);
            }
        }
1035946
def save_item(self, item_form, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceAdminSession.update_resource
        if item_form.is_for_update():
            return self.update_item(item_form, *args, **kwargs)
        else:
            return self.create_item(item_form, *args, **kwargs)
1292110
function store( $contentObjectAttribute )
    {
        $domTree = $this->domTree();
        if ( $domTree )
        {
            if ( is_object( $contentObjectAttribute ) )
            {
                $this->storeDOMTree( $domTree, false, $contentObjectAttribute );

                $contentObjectAttribute->setAttribute( 'data_text', $this->ContentObjectAttributeData['data_text'] );
                $contentObjectAttribute->storeData();
            }
            else
            {
                $this->storeDOMTree( $domTree, true, $contentObjectAttribute );

            }
        }

        $this->setStorageRequired( false );
    }
490652
function() {
    var test = "chat-bubble-storage-test"
    try {
      localStorage.setItem(test, test)
      localStorage.removeItem(test)
      return true
    } catch (error) {
      console.error(
        "Your server does not allow storing data locally. Most likely it's because you've opened this page from your hard-drive. For testing you can disable your browser's security or start a localhost environment."
      )
      return false
    }
  }
1226112
public static function wrapped_session_put(&$session_object,$key,$value)
    {
        global $TSUGI_SESSION_OBJECT;
        if ( $session_object === null && isset($TSUGI_SESSION_OBJECT) ) $session_object = $TSUGI_SESSION_OBJECT;
        if ( is_object($session_object) ) {
            $session_object->put($key,$value);
            return;
        }
        if ( is_array($session_object) ) {
            $session_object[$key] = $value;
            return;
        }
        if ( isset($_SESSION) ) $_SESSION[$key] = $value;
    }
1134906
def save_object(self, obj):
        
        self.session.add(obj)
        self.session.flush()
        return obj
1356115
function InMemoryStorage() {

	var store = {};
    var self = this;

	this.getItem = function(key) {
		return store[key] || null;
	};

	this.setItem = function(key, value) {
		store[key] = value;
        updateLength();
	};

	this.removeItem = function(key) {
		delete store[key];
        updateLength();
	};

	this.clear = function() {
		store = {};
        updateLength();
	};

    function updateLength() {
        self.length = Object.keys(store).length
    }

    updateLength();
}
682662
function storeFixture() {

  		// Avoid overwriting user-defined values
  		if (hasOwn.call(config, "fixture")) {
  			return;
  		}

  		var fixture = document.getElementById("qunit-fixture");
  		if (fixture) {
  			config.fixture = fixture.innerHTML;
  		}
  	}
335479
function(persist) {
          /**
          * is Persistant or not
          * @property {boolean} isPersisted Persistant property
          * @memberof AbstractLocalStorage
          */
          this.isPersisted = persist;

          this.myStore = null;
          /**
          * Is storage supported
          * @method isSupported
          * @memberof AbstractLocalStorage
          * @returns {boolean} Returns true if supported
          */
          this.isSupported = function() {
            return (typeof (Storage) !== "undefined");
          };

          // true = localStorage, false = sessionStorage
          if (this.isSupported()) {
            //logger.debug("AUGMENTED: localStorage exists");

            if (this.isPersisted) {
              this.myStore = localStorage;
            } else {
              this.myStore = sessionStorage;
            }
          } else {
            logger.warn("AUGMENTED: No localStorage.");
          }

          /**
          * Gets an item from storage
          * @method getItem
          * @memberof AbstractLocalStorage
          * @param {string} key The key in storage
          * @returns {object} Returns object from storage
          */
          this.getItem = function(itemKey) {
            var item = this.myStore.getItem(itemKey);
            if (item) {
              return JSON.parse(item);
            }
            return null;
          };

          /**
          * Sets an item to storage
          * @method setItem
          * @memberof AbstractLocalStorage
          * @param {string} key The key in storage
          * @param {object} object The data to set
          */
          this.setItem = function(itemKey, object) {
            this.myStore.setItem(itemKey, JSON.stringify(object));
          };

          /**
          * Removes an item from storage
          * @method removeItem
          * @memberof AbstractLocalStorage
          * @param {string} key The key in storage
          */
          this.removeItem = function(itemKey) {
            this.myStore.removeItem(itemKey);
          };

          /**
          * Clears storage - <b>Warning: Destructive in non-namespaced instances!</b>
          * @method clear
          * @memberof AbstractLocalStorage
          */
          this.clear = function() {
            this.myStore.clear();
          };

          /**
          * Gets the key from storage for index
          * @method key
          * @memberof AbstractLocalStorage
          * @param {number} i The index in storage
          * @returns {string} Returns the key from storage
          */
          this.key = function(i) {
            return this.myStore.key(i);
          };

          /**
          * The length of storage by keys
          * @method length
          * @memberof AbstractLocalStorage
          * @returns {number} Returns the length of storage by keys
          */
          this.length = function() {
            return this.myStore.length;
          };
        }
1264931
function store(name, val) {
        if (typeof (Storage) !== 'undefined') {
            localStorage.setItem(name, val)
        } else {
            window.alert('Please use a modern browser to properly view this template!')
        }
    }
438065
function getSession(sessions, sessionId) {
  var sess = sessions[sessionId]

  if (!sess) {
    debug('no session in MemoryStore for %s',sessionId);
    return;
  }

  // parse
  sess = JSON.parse(sess)

  var expires = typeof sess.cookie.expires === 'string' ?
    new Date(sess.cookie.expires) :
    sess.cookie.expires

  // destroy expired session
  if (expires && expires <= Date.now()) {
    debug('Session %s is Expired in MemoryStore',sessionId);
    delete sessions[sessionId];
    return;
  }

  return sess
}
3338
function(user) {
        var promise;
        if (AV.User._currentUser !== user) {
          promise = AV.User.logOut();
        } else {
          promise = Promise.resolve();
        }
        return promise.then(function() {
          user._isCurrentUser = true;
          AV.User._currentUser = user;

          var json = user._toFullJSON();
          json._id = user.id;
          json._sessionToken = user._sessionToken;
          return AV.localStorage
            .setItemAsync(
              AV._getAVPath(AV.User._CURRENT_USER_KEY),
              JSON.stringify(json)
            )
            .then(function() {
              AV.User._currentUserMatchesDisk = true;
              return AV._refreshSubscriptionId();
            });
        });
      }
449466
function _storage()
    {
        if (! $this->_session ) {
            // Store in session by realm defined with this authentication domain
            $session = new SessionStore(self::STORAGE_IDENTITY_KEY.'_'.$this->getRealm());
            $this->_session = $session;
        }

        return $this->_session;
    }
1082963
protected void store(HttpServletRequest req, HttpServletResponse resp, String token) {
		HttpSession session = req.getSession();
		session.setAttribute(ATR_SESSION_TOKEN, token);
	}
248690
static function storeInSession( $name, $value )
    {
        $http = eZHTTPTool::instance();
        $preferencesInSession = array();
        if ( $http->hasSessionVariable( eZPreferences::SESSION_NAME ) )
             $preferencesInSession = $http->sessionVariable( eZPreferences::SESSION_NAME );
        $preferencesInSession[$name] = $value;
        $http->setSessionVariable( eZPreferences::SESSION_NAME, $preferencesInSession );
    }
771549
function removeItem(key) {
  cookie$1.removeItem(key);
  session.removeItem(key);

  if (!hasLocalStorage()) {
    return;
  }

  localstorage.removeItem(key);
}
1229284
function(key, value){
		var ls = this._local.localStorage; // null, sessionStorage, or localStorage

		if( value === undefined ) {
			return ls ? ls.getItem(key) : $.cookie(key);
		} else if ( value === null ) {
			if( ls ) {
				ls.removeItem(key);
			} else {
				$.removeCookie(key);
			}
		} else {
			if( ls ) {
				ls.setItem(key, value);
			} else {
				$.cookie(key, value, this.options.persist.cookie);
			}
		}
	}