Read a value from the session.

Parameters

  • null|string $key Key of the entry to be read. If no key is passed, all current session data is returned.
  • array $options Options array. Not used for this adapter method.

Returns

closure Function returning data in the session if successful, `false` otherwise.

Source

						public function read($key = null, array $options = array()) {
		$session = $this->_session;

		return function($self, $params) use ($session) {
			extract($params);

			if (!$key) {
				return $session;
			}
			return isset($session[$key]) ? $session[$key] : null;
		};
	}