Some airports are situated under but outside class B. Climbing flight paths that depart the area may intersect its shelves on the way out. Thus, it is possible to be cleared into and enter B, leave its boundary, and still have a shelf in your path ahead. So how long does a clearance into Bravo last?
You are correct that a number of airports around the country can be found in a scenario like you describe. The good thing is that the situation in your question will not be an issue. The reason? When you get your clearance into the class Bravo airspace (only for a VFR flight as "class Bravo" does not exist for an IFR clearance) you are talking to either an approach controller or (in this case) a departure controller. Your clearance into Bravo airspace is valid until the controller you are talking to requests you to squawk VFR (1200) or they switch you to another controller in the "enroute" environment (i.e ATC center controllers). It is in the departure controller's best interest to keep you under "positive control" while you are anywhere within the vicinity of the Class B airspace.