As long as it is in your glove compartment or trunk, and you are not driving under the influence, you cannot get in trouble by the police.
You must be at least 21 years old to possess marijuana in states where it is legal. If there is evidence of a broken seal of a container with marijuana in it, that is cause for you to be charged by police. Be sure to be aware of how many ounces of marijuana your state allows you to possess at a time.
The typical "no open container" laws for alcohol also apply to marijuana. You can be charged with a traffic offense if the marijuana product seal has been broken, some of the product has been consumed or there's evidence that it was used in the car. The best thing to do is have it put away in the glove compartment or your trunk. A cop cannot get you in trouble if it is stored away properly and the seal is not broken. The only way you can get in trouble is if it is within reach of you or you are under the influence while driving.Amount of personal, public possession per state :1 oz: California, Alaska, Washington, Oregon, Nevada, Colorado, Massachusetts, Arizona .2 oz: District of Columbia.2 1/2 oz: Maine.