public function consume($name)
    {
        if (empty($name)) {
            return null;
        }
        $value = $this->read($name);
        if ($value !== null) {
            $this->_overwrite($_SESSION, Hash::remove($_SESSION, $name));
        }

        return $value;
    }
public function consume($name)
    {
        if (empty($name)) {
            return null;
        }
        $value = $this->read($name);
        if ($value !== null) {
            $this->_overwrite($_SESSION, Hash::remove($_SESSION, $name));
        }

        return $value;
    }
public function consume ( $ name ) { if ( empty ( $ name ) ) { return null ; } $ value = $ this -> read ( $ name ) ; if ( $ value !== null ) { $ this -> _overwrite ( $ _SESSION , Hash :: remove ( $ _SESSION , $ name ) ) ; } return $ value ; }
Reads and deletes a variable from session.

@param string $name The key to read and remove (or a path as sent to Hash.extract).
@return mixed The value of the session variable, null if session not available,
session not started, or provided name not found in the session.
Reads and deletes a variable from session .