lithium\storage\session\adapter\Memory::read()

public method

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) {
			if (!$params['key']) {
				return $session;
			}
			return isset($session[$params['key']]) ? $session[$params['key']] : null;
		};
	}