Technically, Flight Following is not a clearance through any controlled or restricted airspace. The pilot is still responsible for obtaining any clearances required.
However, since the controller knows where you are going, they usually will clear you through any controlled airspace if it is not too busy.
Since flight following is given on a workload permitting basis, you must keep in mind, such clearances are not automatic. So, if you do have flight following and you are nearing Class B airspace and haven't received a clearance, request it.
Your initial call up would be:
You- "Philadelphia Approach, Cessna 12345"
ATC- "Cessna 12345, Philadelphia Approach, go ahead."
You- "Cessna 12345 is a Cessna 172, 5 miles west of the Pottstown VOR at Three thousand five hundred, en route from Perkiomen to Trenton-Robinsville, request flight following." You might also add "We'd also like to get cleared through Philadelphia Class B and fly direct."
This way, you can alter your plan early if clearance is denied.
ATC "Cessna 12345 Philadelphia Altimeter is 30.10 Squawk 1025 and ident"
You "30.10, Squwak 1025,ident, Cessna 12345." (Hit ident)
ATC "Cessna 12345, radar contact, maintain VFR, cleared through Philadelphia Class Bravo turn right heading 160, maintain three thousand five hundred."
You " Right to 160, maintain VFR, three thousand five hundred, cleared through Philadelphia Class Bravo."
You will receive and follow heading and altitudes issued by ATC until you are clear of the Class B airspace.
(Or you may be told to remain clear of Class B. Depends on how busy the airspace/controller is.)
So, bottom line, though flight following is not a clearance, you will often get one without having to ask. But it is your responsibility to get one.