If the police want to obtain consent to perform a search of a property, who do they have to obtain it from?
Can my friend who doesn't legally own the house, or pay rent, but is just staying with me for a few days consent to search?
What if one of my guests, who doesn't live there at all, answers the door with me, and I say they may not search but the guest says they can?
What if initially the guest lets them in and they start searching but when I find out I object?
What if someone who doesn't live in my house and wasn't invited to my house (just wanders in while I'm having a party) allows them in?
What if a cat-burglar gets surprised by them and pretends he lives there, and consents to search?
I'm interested in the US generally, but if this is something that varies across states, a breakdown of what is typical, with examples from a few states, would still be a good answer.