Google's flexible sampling with Leaky Paywall
If you are metering your content with Leaky Paywall you are all set. As long as you set your restrictions to offer 1 or more free articles, Google will ignore the PHP cookies/javascript and be able to index all your content.
If you have restricted your content to 0 free articles (hard paywall), you will need to set up a schema to let Google bypass Leaky Paywall: https://developers.google.com/search/docs/data-types/paywalled-content