impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
340 stars 191 forks source link

Session cookies are created on every page load preventing various caches #521

Closed DevinWalker closed 8 years ago

DevinWalker commented 8 years ago

Reported by several users including here: https://wordpress.org/support/topic/session-cookie-set-on-every-page-load-causes-cache-miss?replies=1

It looks like Give sets two PHP session cookies on every page load as long as the plugin is merely installed and active. This prevents Varnish from working in some Managed WordPress hosting and visitors never get cached pages as a result. With any kind of load from concurrent users, overall performance degrades badly. Do you have a workaround for situations like this?

Related to: Session cookies are created on every page load: https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/4284

DevinWalker commented 8 years ago

Needs testing. How to test:

Scenario 1: WITH PHP Sessions enabled (default)

  1. Clear all cookies in browser and not logged in
  2. Navigate to a donation form
  3. Make a test donation, make a PayPal Standard test donation
  4. In both cases you should be brought to the "Donation Confirmation" page showing your donation details
  5. Navigate to another non-Give page and navigate back, you should still see details

Scenario 2: Without PHP Sessions enabled:

  1. Add define('GIVE_USE_PHP_SESSIONS', false); to your wp-config.php perform steps 1-5 mentioned above

@mathetos

ibndawood commented 8 years ago

@DevinWalker, I will test this scenario and get back to you as soon as possible

DevinWalker commented 8 years ago

Ok, bunch of fixes in #561 now to test on:

DevinWalker commented 8 years ago

Problem detected with WP Engine. I think this has to do with the cache exception not being in place on this site. I pinged support about adding a cache exception to the page and once they did it immediately worked. I'm going to contact Dustin & Jason Cosper over there and see if anything can be done about it on their end. For now, this article will help our users: https://givewp.com/documentation/resources/wp-engine-cache-exclusion-donation-confirmation-page/