Hi VM,
I'm unfamiliar with this formula (do you really mean multiplying N1 by N2?). Regardless, the answer to this can be long, but in short, in the original book Cohen didn't go into all possible cases of the GLM. In PALM, Cohen's d is computed as COPE/sqrt(variance of the residuals).
The relationship of this with the t statistic depends on a certain term that is computed as (C'*(M'*M)^(-1)*C)^-(1/2), where M is the full design matrix (effects of interest and nuisance) and C is the contrast.
All the best,
Anderson