Access Visit ID

I’d like to be able to access the Visit ID (not visitor ID) in PHP and Javascript, we need this because I want to export the specific pages that someone visited on a session.

Has anyone come across a method to access these as part of the TrackPageView (or similar) push?