public function read($key = null, array $options = []) {
		return function($params) {
			$key = $params['key'];
			if (!$key) {
				if (isset($_COOKIE[$this->_config['name']])) {
					return $_COOKIE[$this->_config['name']];
				}
				return [];
			}
			if (strpos($key, '.') !== false) {
				$key = explode('.', $key);

				if (isset($_COOKIE[$this->_config['name']])) {
					$result = $_COOKIE[$this->_config['name']];
				} else {
					$result = [];
				}

				foreach ($key as $k) {
					if (!isset($result[$k])) {
						return null;
					}
					$result = $result[$k];
				}
				return $result;
			}
			if (isset($_COOKIE[$this->_config['name']][$key])) {
				return $_COOKIE[$this->_config['name']][$key];
			}
		};
	}
public function read($key = null, array $options = []) {
		return function($params) {
			$key = $params['key'];
			if (!$key) {
				if (isset($_COOKIE[$this->_config['name']])) {
					return $_COOKIE[$this->_config['name']];
				}
				return [];
			}
			if (strpos($key, '.') !== false) {
				$key = explode('.', $key);

				if (isset($_COOKIE[$this->_config['name']])) {
					$result = $_COOKIE[$this->_config['name']];
				} else {
					$result = [];
				}

				foreach ($key as $k) {
					if (!isset($result[$k])) {
						return null;
					}
					$result = $result[$k];
				}
				return $result;
			}
			if (isset($_COOKIE[$this->_config['name']][$key])) {
				return $_COOKIE[$this->_config['name']][$key];
			}
		};
	}
public function read ( $ key = null , array $ options = [ ] ) { return function ( $ params ) { $ key = $ params [ 'key' ] ; if ( ! $ key ) { if ( isset ( $ _COOKIE [ $ this -> _config [ 'name' ] ] ) ) { return $ _COOKIE [ $ this -> _config [ 'name' ] ] ; } return [ ] ; } if ( strpos ( $ key , '.' ) !== false ) { $ key = explode ( '.' , $ key ) ; if ( isset ( $ _COOKIE [ $ this -> _config [ 'name' ] ] ) ) { $ result = $ _COOKIE [ $ this -> _config [ 'name' ] ] ; } else { $ result = [ ] ; } foreach ( $ key as $ k ) { if ( ! isset ( $ result [ $ k ] ) ) { return null ; } $ result = $ result [ $ k ] ; } return $ result ; } if ( isset ( $ _COOKIE [ $ this -> _config [ 'name' ] ] [ $ key ] ) ) { return $ _COOKIE [ $ this -> _config [ 'name' ] ] [ $ key ] ; } } ; }
Read a value from the cookie.

@param null|string $key Key of the entry to be read. If $key is null, returns
all cookie key/value pairs that have been set.
@param array $options Options array. Not used in this adapter.
@return \Closure Function returning data in the session if successful, `null` otherwise.
Read a value from the cookie .