public function check($key = null)
    {
        if (empty($key)) {
            return false;
        }

        return $this->read($key) !== null;
    }
public function check($key = null)
    {
        if (empty($key)) {
            return false;
        }

        return $this->read($key) !== null;
    }
public function check ( $ key = null ) { if ( empty ( $ key ) ) { return false ; } return $ this -> read ( $ key ) !== null ; }
Returns true if given key is set in the cookie.

@param string|null $key Key to check for
@return bool True if the key exists
Returns true if given key is set in the cookie .