James, thanks for taking care of this issue so quickly and pushing out the updates.
While the temporary fix of defining not to use sessions works for now, I would encourage you to update the code so that the session_start directive takes place right before you start working with sessions, within the PayPal express code. This way, sessions are never touched in the first place, unless PayPal is used.
Now the current issue with the plugin still remains for those who don’t know about this particular workaround – the default behavior will always kill caching as it stands, which is not good. The default behavior of any plugin should never be to start sessions – please refer to WordPress documentation, which clearly states that WordPress does not use sessions and instead relies on cookies for storing any temporary or session data.
Try this yourself – on any install of PM Pro, try to grab the front page of the WordPress blog using curl. For example: curl -I https://blogname.com. You will see that with your plugin enabled, curl will return a PHPSESSID header, which is the indication of a session start. With such behavior, try to put this website behind a reverse proxy (say Cloudflare) and see that it will not do anything, since the pages will never be cached. Cache will always return “miss” for session-enabled pages.
I suggest we build a better world with not initializing sessions in plugins, unless one is in the process of checking out via a gateway such as PayPal.
Hope it makes sense – I am sure many of your current plugin users would appreciate such a change.
Sincerely,
Nasim