This is the same in the USA and most countries. "The border" (really, any ingress point where you haven't passed CBP) is effectively a rights-free zone. It's important to remember that you should have nothing that will cause you difficulty if it is seized, copied, or damaged no matter how you enter the country.