Write a value to the session.

Parameters

  • string $key Key of the item to be stored.
  • mixed $value The value to be stored.
  • array $options Options array. Not used for this adapter method.

Returns

closure Function returning boolean `true` on successful write, `false` otherwise.

Source

						public static function write($key, $value, array $options = array()) {
		if (!static::isStarted() && !static::_start()) {
			throw new RuntimeException("Could not start session.");
		}
		$class = __CLASS__;

		return function($self, $params) use ($class) {
			return $class::overwrite(
				$_SESSION, Set::insert($_SESSION, $params['key'], $params['value'])
			);
		};
	}