You can delete “in my state” and add “in the United States,” although the glove box probably cannot be searched if it is closed. Actually, I should add a caveat that this is just Fourth Amendment jurisprudence. Your state may provide a greater level of protection than the Fourth Amendment does. But I’m not doing a fifty state legal survey for you people.
Car search cases are among the most complex and fact-intensive Fourth Amendment cases that the courts deal with. What follows is, of course, not legal advice, and I’m not your lawyer, so don’t call me if you get pulled over. I mean it!
This page lists most of the leading cases, and they lay out an interesting story. This chart (warning: pdf) lists the types of stops under the Fourth Amendment. Scroll down to the fourth page to look at vehicle and container searches.
Also, “wingspan” is an important consideration, and that’s the basis for the search that crowmanyclouds posted about. See New York v. Belton. In Belton, the United States Supreme Court held that the warrantless search of the pocket of the defendant’s jacket in the car was unlawful, because the defendant was outside the car and already had been arrested. As a result, what was inside the car was outside the defendant’s reach, and so could not be searched.
In other words, as crowmanyclouds noted, a search of a person’s “wingspan” – “the area ‘within his immediate control’” – is not generally a Fourth Amendment violation.
So to get to the OP: the police can search the boxes in the back seat of your car under a couple circumstances: if you are inside the car, and the boxes are open and within your reach, and you are under arrest (i.e., you are getting a ticket). Alternatively, the police can search all closed containers (including boxes, luggage, the glove compartment and the trunk) if they have probable cause for the search. The probable cause must arise before the search is initiated and must be such that, if a magistrate were there with the cops, the magistrate would issue a warrant. See United States v. Ross.
Did I mention that the car cases are really confusing?