Hi Daniele
There is a quirk, in SPS that :
enablerewritecookiedomain=yes
will only works when the The Web Agent for the SPS is enabled.
I don't believe that should be the case, so my personal opinion is that it is a bug, but that is how it currently works.
The handing of SMSESSION may be special, but from what your describing above it would seem the rewrite of the domains would not be occurring even for normal set-cookie commands.
Are you able to enable the webagent, (but perhaps make the resources unprotected) in the SPS to see if that works for you?
I have a related case I am working on at the moment (where if you have host only set-cookie, which has no domain, then sometimes you may still want SPS to write the new domain). So otherwise, If you want we can open a support case and persue it as product bug.
Cheers - Mark