Cohesive stresses and size effects in elasto-plastic and quasi-brittle materials