I hate that crap to no end. The problem is that they will need at least a reasonable suspicion to go through your car like that, but they can simply ask even if they have no reason. And if you consent...
I think a lot of people get intimidated by the uniform, cops demeanor, etc., and just voluntarily give up their rights by consenting. Fuck that...