It can be a number of things, including the dog being left alone or being ignored by you when guests come to your home. If its biting completely unknow people then may be it was not socialised properly as a pup, which should not happen in cockers as they are very friendly dogs.
May be you should relate food to starngers and ask the strangers to give tit bits to your dog when they come.
I feel it is doing it to get your attention. It can also be some problem like ear infestion etc. get its ears checked by the vet and do a general check.
C how it goes and let me know