is there a legal way to consume alcohol bought at a store, outside of a home, hotel room, etc.? - eviltoast

I’m thinking in the U.S. and Canada. For example, if you’re on vacation, you’ve checked out of your hotel room and have several hours until your flight, and you have some cans of beer left over. I know you could sneakily drink them in a park or something, but I’m just curious if there’s any way to do it that’s legal.