OK I spend almost half the year traveling up and down the coast and have learned a few things in the past decade or two of traveling. I've traveled/camped by car, van, and truck and camper.
It is illegal to camp in your vehicle in every town, state, and municipality from BC to the mexican border. This is the same vagrant laws that allow police to move along the homeless. Now that being said if you are courteous and keep a low profile it can be done, and I have done it for months at a time.
Rest areas are a good place to stop, you can not camp per-say at a rest area, but each province/state allows for a rest stop for weary travelers. I can't remember exactly but I believe its 8hrs in BC, 10hrs in Washington, 14hrs in Oregon, and 12 in Califorina. Sorry I have it written down in my truck, but can't remember off the top of my head. This is more then enough time to catch a few Z's. Now that being said some rest ares are known problem areas and the cops may move people along a lot quicker if the are worried about safety. The best thing to do then is ask where is the best place for a weary traveller to stop.
Forestry roads are a great and quite place to stop but as someone else mentioned make sure you are well off the road to allow the logging trucks to get by. Often City parks and waysides will be tolerated as long as you aren't making a problem and are quite.
Other great places to stop are at weigh stations and truck stops. These are a bit noisier but they are fine places to sleep and usuallly have a bathroom and some kind of services.
Some other great places to stay are church parking lots (just be out before service the next morning), large malls and Walmarts. Infact Walmart publishes a book called "camping Walmart" which shows all the locations and where to park. If you are parking in a mall lot, park in the far back corner where you are out of the way and it's good practice to just ask the manager on shift where might be an ok place to leave your car overnight. As with any spot the more courteous and polite you are the easier it will be for you to camp there.
Please note that camping in urban areas can be dangerous. Rest areas and truck stops are notorious for crime and trouble makers. If someone is harassing you don't get out of your vehicle, just get in the drivers seat and get out of there. I have heard a lot of horror stories from fellow travelers.
As for drinking while stopped. This is a tricky situation and it really depends on the mood of the cop. You are dealing with alcohol in a public place, open alcohol in the vehicle, and impaired driving. In my past experiences it is best if you are in the passenger seat and no keys in the ignition (even for the radio) be polite and let them know that you stopped to rest for the night and had a couple to relax and are just sleeping it off.
Hopefully that helps, camping in urban settings is a bit of a grey area but if done with respect can turn out very well.