For example, Spanish corteza and French écorce (bark) both ultimately come from PIE *(s)ker- but they have different Latin roots (cortex and scortea). Does that stop them from being cognate?
Cognate doesn't have a single meaning and is sometimes used more strictly, and sometimes used more loosely
Sensu stricto, cognate means that two forms descend from identical forms in an earlier language. For instance, English "ship" and German "Schiff" both come from the same proto-Germanic word: *skipą "ship"
In a looser sense, two words may be considered cognate if they have the same root, but with different affixes (if any). When speaking with strict accuracy, such words are said to be "akin to" each other rather than "cognate with"
The example you give of corteza < cortex and écorce < escortea fits with the latter sense, but not the former. If speaking somewhat loosely, they're cognate, but if speaking more strictly, I'd say that corteza was akin to écorce
These words are cognate. Two words are cognate if they share an etymological origin.