The server does not receive the path and domain infos so you cant differentiate at that point.
Jeah, domain wise if you have a cookie set for example.com and test.example.com, if the user is on the later it would send both cookies. This may be wanted for a common login system. In general yes it can be avoided if potential conflicting apps use different cookie names by default.