S2member + Varnish Cache Stripping Cookie Sessions Issue

I’ve had this issue for the last 2 years.

After a user processes their membership payment on through paypal, and is redirected back to make a user account, Varnish seems to strip the cookie session.

Thus, when a client creates a new user account, that user is not automatically upgraded to a paid member.

I basically have to go into admin, to link up their paypal ID, along with , and activate their account.

Disabling Varnish cache server-wide fixes the issue.

Unfortunately, varnish cache is just too important now for speed improvements and SEO.

I found the following article detailing exceptions for woocommerce:

I just don’t know what to add for S2member.

URL:

?add-to-cart=
^/(cart|my-account/|checkout|wc-api/|add-to-cart|addons|logout|lost-password|product/*|wp-admin|wp-login)
Cookie:

woocommerce_cart_hash
woocommerce_items_in_cart
wp_woocommerce_session_

Thanks again.

Hi Leo.

That’s interesting. s2Member sends the user ID as part of the transaction, so even if his cookie is lost after he left the site, the payment gateway should still notify s2Member that it was his account and it’d be upgraded, instead of that payment going towards a new registration.

It could be true that when he comes back, he’s not logged into your site anymore, and needs to log back in, but I’m not sure how that connection between the payment and his account would get lost that way.

What’s important to upgrade an existing account, is that he is logged in to it when he loads the page with the s2 payment button or form. That way, s2 will add his user ID to the payment, otherwise it won’t.

Logged into a test user account, and with s2’s logging enabled, could you please reproduce the behavior your describing, and show me the log entries that result from it? Please edit out sensitive data before posting it here, or send it to me privately.

I look forward to your update. :slight_smile:

And also, after reproducing the problem in your test and having logged it, please disable Varnish for a moment and do the same test. I want to see what the difference is between the with and without Varnish s2 log entries.

Thanks!

The payment process is:
sales page -> paypal payment -> thank you page -> create account (account created, but not upgraded automatically)

Gateway-core-rtn.log

------------------ Varnish Disabled -------------------
LOG ENTRY: Wed Dec 26th, 2018 @ precisely 6:13 am UTC
PHP v7.2.12-1+0~20181112102353.11+jessie~1.gbp55f215 :: WordPress v5.0.2 :: optimizeMember v1.2.9 :: optimizeMember Pro v1.2.9
Memory 18.24 MB :: Real Memory 20.00 MB :: Peak Memory 18.39 MB :: Real Peak Memory 20.00 MB
premium23.com/?optimizemember_paypal_return=1&optimizemember_paypal_return_tra=fnhlOjBkYmZmYjAyYjljMDljZWIzODAyZGM2YWE0YjYxMWNifKTMuJ20iYCEjJ_Cen1uba20gGS-W31deox_WmOOpJCBg225mlRvvn9za2KHcHG3bXyNSpqqRXy2gXiYSpZXYZRgho1DxbBxjsVeg3ptZHlphIBkvlt8XXrQv0t8xmuHiWt8Z2Wlbn1_ZKO0eImpfmSEdXVIcZZ7dYFp0Jp0cJlbV451UnWKwo2FXnGyvahtdMaYWYVDbF7LmIJjY8Wjt3GEvn9bbFZ8Z32keo2IWK2hwMKRiZtFfLaBeZVidGqJU1mFtVmFs7SFiVjNcYNreWqJjld8UXhbjICKnHuLa3iysbColaWpuGd9pHqJgHBmZ4O0X4xqVKN6qne_jIZujIKHhblVg4S1i7iGhHl9lX1bjts&optimizemember_paypal_return_success=https%3A%2F%2Fpremium23.com%2Fthank-you&tx=69X18763P7441522C&st=Completed&amt=0.01&cc=USD&cm=premium23.com&item_number=1&sig=FScU4v%2F%2BuhfS%2FuFNfEOudRTUbyqCSQGHngZje36iZXOD4Unf4zy5RClneLinifoHsujLU16zPB%2FBP7IPTYer57BovMiUy5u4SijUS9pnG7pVh0oPsG%2FjYrf89ale7oz6zTSUUFVZKvYJ%2BpZlu0%2FqdLzzIT0EdGXQbe032CfnmqA%3D
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
array (
‘transaction_subject’ => ‘Description’,
‘payment_date’ => ‘22:13:49 Dec 25, 2018 PST’,
‘txn_type’ => ‘subscr_payment’,
‘subscr_id’ => ‘I-4E7NLGC87HKT’,
‘last_name’ => ‘K’,
‘option_selection1’ => ‘premium23.com’,
‘option_selection2’ => ‘187.160.10.84’,
‘residence_country’ => ‘CA’,
‘item_name’ => ‘Description’,
‘payment_gross’ => ‘0.01’,
‘mc_currency’ => ‘USD’,
‘business’ => ‘test@test.com’,
‘payment_type’ => ‘instant’,
‘protection_eligibility’ => ‘Eligible’,
‘payer_status’ => ‘unverified’,
‘payer_email’ => ‘testpay@premium23.com’,
‘txn_id’ => ‘69X18763P7441522C’,
‘receiver_email’ => ‘test@test.com’,
‘first_name’ => ‘leo’,
‘option_name1’ => ‘Originating Domain’,
‘invoice’ => ‘5c231b82de274~187.160.10.84’,
‘payer_id’ => ‘HXZ45GQGX37R6’,
‘option_name2’ => ‘Customer IP Address’,
‘receiver_id’ => ‘JWTVNPUQLP3JN’,
‘item_number’ => ‘1’,
‘payment_status’ => ‘Completed’,
‘payment_fee’ => ‘0.01’,
‘mc_fee’ => ‘0.01’,
‘mc_gross’ => ‘0.01’,
‘custom’ => ‘premium23.com’,
‘charset’ => ‘windows-1252’,
‘option_selection’ => ‘premium23.com’,
‘option_name’ => ‘Originating Domain’,
‘optimizemember_log’ =>
array (
0 => ‘Return-Data received on: Wed Dec 26, 2018 6:13:57 am UTC’,
1 => ‘optimizeMember POST vars verified through a POST back to PayPal.’,
2 => ‘optimizeMember originating domain ( $_SERVER["HTTP_HOST"] ) validated.’,
3 => ‘optimizeMember txn_type identified as ( web_accept|subscr_signup|subscr_payment ).’,
4 => ‘optimizeMember txn_type identified as ( web_accept|subscr_signup|subscr_payment ) w/o update vars.’,
5 => ‘Registration Cookies set on ( web_accept|subscr_signup|subscr_payment ) w/o update vars.’,
6 => ‘Transient Tracking Cookie set on ( web_accept|subscr_signup|subscr_payment ) w/o update vars.’,
7 => ‘Redirecting Customer to a custom URL on success: https://premium23.com/thank-you’,
),
‘subscr_gateway’ => ‘paypal’,
‘subscr_baid’ => ‘I-4E7NLGC87HKT’,
‘subscr_cid’ => ‘I-4E7NLGC87HKT’,
‘level’ => ‘1’,
‘ccaps’ => NULL,
‘eotper’ => NULL,
‘ip’ => ‘187.160.10.84’,
‘period1’ => ‘1 D’,
‘mc_amount1’ => ‘0.01’,
‘period3’ => ‘1 M’,
‘mc_amount3’ => ‘0.01’,
‘recurring’ => ‘0.01’,
‘initial_term’ => ‘1 D’,
‘initial’ => ‘0.01’,
‘regular’ => ‘0.01’,
‘regular_term’ => ‘1 M’,
‘currency’ => ‘USD’,
‘currency_symbol’ => ‘$’,
‘optimizemember_paypal_return_success’ => ‘https://premium23.com/thank-you’,
‘optimizemember_paypal_return_tra’ => ‘fnhlOjBkYmZmYjAyYjljMDljZWIzODAyZGM2YWE0YjYxMWNifKTMuJ20iYCEjJ_Cen1uba20gGS-W31deox_WmOOpJCBg225mlRvvn9za2KHcHG3bXyNSpqqRXy2gXiYSpZXYZRgho1DxbBxjsVeg3ptZHlphIBkvlt8XXrQv0t8xmuHiWt8Z2Wlbn1_ZKO0eImpfmSEdXVIcZZ7dYFp0Jp0cJlbV451UnWKwo2FXnGyvahtdMaYWYVDbF7LmIJjY8Wjt3GEvn9bbFZ8Z32keo2IWK2hwMKRiZtFfLaBeZVidGqJU1mFtVmFs7SFiVjNcYNreWqJjld8UXhbjICKnHuLa3iysbColaWpuGd9pHqJgHBmZ4O0X4xqVKN6qne_jIZujIKHhblVg4S1i7iGhHl9lX1bjts’,
)
------------------ Varnish Enabled -------------------
LOG ENTRY: Wed Dec 26th, 2018 @ precisely 6:21 am UTC
PHP v7.2.12-1+0~20181112102353.11+jessie~1.gbp55f215 :: WordPress v5.0.2 :: optimizeMember v1.2.9 :: optimizeMember Pro v1.2.9
Memory 18.24 MB :: Real Memory 6.00 MB :: Peak Memory 18.39 MB :: Real Peak Memory 6.00 MB
premium23.com/?optimizemember_paypal_return=1&optimizemember_paypal_return_tra=fnhlOmRjZDA4N2EyNGJkZDI1M2Y4NzY2YWIwYjhlMzMxNDdmfKTMuJ20iYCEjJ_Cen1uba20gGS-W31deox_W2OOpJCBg225mlRvvn9za2KHcHG3bXyNSpqqRXy2gXiYSpZXYZRgho1DxbBxjsVeg3ptZHlphIBkvlt8XXrQv0t8xmuHiWt8Z2Wlbn1_ZKO0eImpfmSEdXVIcZZ7dYFp0Jp0cJlbV451UnWKwo2FXnGyvahtdMaYWYVDbF7LmIJjY8Wjt3GEvn9bbFZ8Z32keo2IWK2hwMKRiZtFfLaBeZVidGqJU1mFt4S1s4aDtonNcYNreWqJjld8UXhbjICKnHuLa3iysbColaWpuGd9pHqJgHBmlnqHWoybXHZ0eH2TXYmWWldXjINYtbKGhodWtXewloNbjts&optimizemember_paypal_return_success=https%3A%2F%2Fpremium23.com%2Fthank-you&tx=6T068886GK3218143&st=Completed&amt=0.02&cc=USD&cm=premium23.com&item_number=1&sig=sxDS9kPy8WHK5ZUa5breziEw%2B1%2B%2FuwKDH8T0XH7lclF5XeYGJxyXUZUTr0TwplRQLCWsJQsFe%2BH%2Fm%2FdKv4pPGk21dYFiFTGsD2SaO02jsSTSdbznP0luN%2Bjb0YOhMpFb9jS8zZ0RskKc2stv6t3Lgm6Qfp69mb%2Fx%2FtzQekDFxlU%3D
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
array (
‘transaction_subject’ => ‘Description’,
‘payment_date’ => ‘22:21:40 Dec 25, 2018 PST’,
‘txn_type’ => ‘subscr_payment’,
‘subscr_id’ => ‘I-DCC5A5X825YA’,
‘last_name’ => ‘K’,
‘option_selection1’ => ‘premium23.com’,
‘option_selection2’ => ‘187.160.10.84’,
‘residence_country’ => ‘CA’,
‘item_name’ => ‘Description’,
‘payment_gross’ => ‘0.02’,
‘mc_currency’ => ‘USD’,
‘business’ => ‘test@test.com’,
‘payment_type’ => ‘instant’,
‘protection_eligibility’ => ‘Eligible’,
‘payer_status’ => ‘unverified’,
‘payer_email’ => ‘testpay@premium23.com’,
‘txn_id’ => ‘6T068886GK3218143’,
‘receiver_email’ => ‘test@test.com’,
‘first_name’ => ‘leonidas’,
‘option_name1’ => ‘Originating Domain’,
‘invoice’ => ‘5c231dcbd70de~187.160.10.84’,
‘payer_id’ => ‘HXZ45GQGX37R6’,
‘option_name2’ => ‘Customer IP Address’,
‘receiver_id’ => ‘JWTVNPUQLP3JN’,
‘item_number’ => ‘1’,
‘payment_status’ => ‘Completed’,
‘payment_fee’ => ‘0.02’,
‘mc_fee’ => ‘0.02’,
‘mc_gross’ => ‘0.02’,
‘custom’ => ‘premium23.com’,
‘charset’ => ‘windows-1252’,
‘option_selection’ => ‘premium23.com’,
‘option_name’ => ‘Originating Domain’,
‘optimizemember_log’ =>
array (
0 => ‘Return-Data received on: Wed Dec 26, 2018 6:21:50 am UTC’,
1 => ‘optimizeMember POST vars verified through a POST back to PayPal.’,
2 => ‘optimizeMember originating domain ( $_SERVER["HTTP_HOST"] ) validated.’,
3 => ‘optimizeMember txn_type identified as ( web_accept|subscr_signup|subscr_payment ).’,
4 => ‘optimizeMember txn_type identified as ( web_accept|subscr_signup|subscr_payment ) w/o update vars.’,
5 => ‘Registration Cookies set on ( web_accept|subscr_signup|subscr_payment ) w/o update vars.’,
6 => ‘Transient Tracking Cookie set on ( web_accept|subscr_signup|subscr_payment ) w/o update vars.’,
7 => ‘Redirecting Customer to a custom URL on success: https://premium23.com/thank-you’,
),
‘subscr_gateway’ => ‘paypal’,
‘subscr_baid’ => ‘I-DCC5A5X825YA’,
‘subscr_cid’ => ‘I-DCC5A5X825YA’,
‘level’ => ‘1’,
‘ccaps’ => NULL,
‘eotper’ => NULL,
‘ip’ => ‘187.160.10.84’,
‘period1’ => ‘1 D’,
‘mc_amount1’ => ‘0.02’,
‘period3’ => ‘1 M’,
‘mc_amount3’ => ‘0.01’,
‘recurring’ => ‘0.01’,
‘initial_term’ => ‘1 D’,
‘initial’ => ‘0.02’,
‘regular’ => ‘0.01’,
‘regular_term’ => ‘1 M’,
‘currency’ => ‘USD’,
‘currency_symbol’ => ‘$’,
‘optimizemember_paypal_return_success’ => ‘https://premium23.com/thank-you’,
‘optimizemember_paypal_return_tra’ => ‘fnhlOmRjZDA4N2EyNGJkZDI1M2Y4NzY2YWIwYjhlMzMxNDdmfKTMuJ20iYCEjJ_Cen1uba20gGS-W31deox_W2OOpJCBg225mlRvvn9za2KHcHG3bXyNSpqqRXy2gXiYSpZXYZRgho1DxbBxjsVeg3ptZHlphIBkvlt8XXrQv0t8xmuHiWt8Z2Wlbn1_ZKO0eImpfmSEdXVIcZZ7dYFp0Jp0cJlbV451UnWKwo2FXnGyvahtdMaYWYVDbF7LmIJjY8Wjt3GEvn9bbFZ8Z32keo2IWK2hwMKRiZtFfLaBeZVidGqJU1mFt4S1s4aDtonNcYNreWqJjld8UXhbjICKnHuLa3iysbColaWpuGd9pHqJgHBmlnqHWoybXHZ0eH2TXYmWWldXjINYtbKGhodWtXewloNbjts’,
)

Gateway-core-IPN Handler

------------- VARNISH DISABLED -------------
LOG ENTRY: Wed Dec 26th, 2018 @ precisely 6:13 am UTC
PHP v7.2.12-1+0~20181112102353.11+jessie~1.gbp55f215 :: WordPress v5.0.2 :: optimizeMember v1.2.9 :: optimizeMember Pro v1.2.9
Memory 19.34 MB :: Real Memory 22.00 MB :: Peak Memory 19.79 MB :: Real Peak Memory 22.00 MB
premium23.com/?optimizemember_paypal_notify=1
User-Agent: PayPal IPN ( paypal.com/ipn )
array (
‘txn_type’ => ‘subscr_signup’,
‘subscr_id’ => ‘I-4E7NLGC87HKT’,
‘last_name’ => ‘K’,
‘option_selection1’ => ‘premium23.com’,
‘option_selection2’ => ‘187.160.10.84’,
‘residence_country’ => ‘CA’,
‘mc_currency’ => ‘USD’,
‘item_name’ => ‘Description’,
‘amount1’ => ‘0.01’,
‘business’ => ‘@premium23.com’,
‘amount3’ => ‘0.01’,
‘recurring’ => ‘0.01’,
‘verify_sign’ => ‘AfWpLFl8m8VmpUirEIiHO26JSljjAGvr6CjPtvD.OYI8FQP6MGS9segn’,
‘payer_status’ => ‘unverified’,
‘payer_email’ => ‘testpay@premium23.com’,
‘first_name’ => ‘leo’,
‘receiver_email’ => '
@premium23.com’,
‘payer_id’ => ‘HXZ45GQGX37R6’,
‘option_name1’ => ‘Originating Domain’,
‘invoice’ => ‘5c231b82de274~187.160.10.84’,
‘option_name2’ => ‘Customer IP Address’,
‘reattempt’ => ‘1’,
‘item_number’ => ‘1’,
‘subscr_date’ => ‘22:13:44 Dec 25, 2018 PST’,
‘custom’ => ‘premium23.com’,
‘charset’ => ‘windows-1252’,
‘notify_version’ => ‘3.9’,
‘period1’ => ‘1 D’,
‘mc_amount1’ => ‘0.01’,
‘period3’ => ‘1 M’,
‘mc_amount3’ => ‘0.01’,
‘ipn_track_id’ => ‘ac4e0509b4d2a’,
‘option_selection’ => ‘premium23.com’,
‘amount’ => ‘0.01’,
‘option_name’ => ‘Originating Domain’,
‘period’ => ‘1 D’,
‘mc_amount’ => ‘0.01’,
‘optimizemember_log’ =>
array (
0 => ‘IPN received on: Wed Dec 26, 2018 6:13:57 am UTC’,
1 => ‘optimizeMember POST vars verified through a POST back to PayPal.’,
2 => ‘optimizeMember originating domain ($_SERVER["HTTP_HOST"]) validated.’,
3 => ‘optimizeMember txn_type identified as ( web_accept|subscr_signup ).’,
4 => ‘optimizeMember txn_type identified as ( web_accept|subscr_signup ) w/o update vars.’,
5 => ‘Signup Confirmation Email sent to: “leo K” testpay@premium23.com.’,
6 => ‘Storing IPN signup vars now. These are associated with a User’s account record; for future reference.’,
),
‘subscr_gateway’ => ‘paypal’,
‘subscr_baid’ => ‘I-4E7NLGC87HKT’,
‘subscr_cid’ => ‘I-4E7NLGC87HKT’,
‘level’ => ‘1’,
‘ccaps’ => NULL,
‘eotper’ => NULL,
‘ip’ => ‘187.160.10.84’,
‘initial_term’ => ‘1 D’,
‘initial’ => ‘0.01’,
‘regular’ => ‘0.01’,
‘regular_term’ => ‘1 M’,
‘currency’ => ‘USD’,
‘currency_symbol’ => ‘$’,
)

LOG ENTRY: Wed Dec 26th, 2018 @ precisely 6:13 am UTC
PHP v7.2.12-1+0~20181112102353.11+jessie~1.gbp55f215 :: WordPress v5.0.2 :: optimizeMember v1.2.9 :: optimizeMember Pro v1.2.9
Memory 18.25 MB :: Real Memory 12.00 MB :: Peak Memory 18.36 MB :: Real Peak Memory 12.00 MB
premium23.com/?optimizemember_paypal_notify=1
User-Agent: PayPal/AUHD-214.0-50275941
array (
‘optimizemember_log’ =>
array (
0 => ‘Unable to verify $_POST vars. This is most likely related to an invalid configuration of optimizeMember, or a problem with server compatibility.’,
1 => ‘array (
‘optimizemember_paypal_notify’ => ‘1’,
)’,
),
)

LOG ENTRY: Wed Dec 26th, 2018 @ precisely 6:14 am UTC
PHP v7.2.12-1+0~20181112102353.11+jessie~1.gbp55f215 :: WordPress v5.0.2 :: optimizeMember v1.2.9 :: optimizeMember Pro v1.2.9
Memory 19.57 MB :: Real Memory 4.00 MB :: Peak Memory 19.98 MB :: Real Peak Memory 4.00 MB
premium23.com/?optimizemember_paypal_notify=1
User-Agent: PayPal IPN ( paypal.com/ipn )
array (
‘mc_gross’ => ‘0.01’,
‘invoice’ => ‘5c231b82de274~187.160.10.84’,
‘protection_eligibility’ => ‘Eligible’,
‘payer_id’ => ‘HXZ45GQGX37R6’,
‘payment_date’ => ‘22:13:49 Dec 25, 2018 PST’,
‘payment_status’ => ‘Completed’,
‘charset’ => ‘windows-1252’,
‘first_name’ => ‘leo’,
‘option_selection1’ => ‘premium23.com’,
‘option_selection2’ => ‘187.160.10.84’,
‘mc_fee’ => ‘0.01’,
‘notify_version’ => ‘3.9’,
‘subscr_id’ => ‘I-4E7NLGC87HKT’,
‘custom’ => ‘premium23.com’,
‘payer_status’ => ‘unverified’,
‘business’ => ‘@premium23.com’,
‘verify_sign’ => ‘AeDkpV-QA-Jq7QUAuTggQ6V9OTj.AWmXWTxoYV2jyupASOsYKKEoqaRZ’,
‘payer_email’ => ‘testpay@premium23.com’,
‘option_name1’ => ‘Originating Domain’,
‘option_name2’ => ‘Customer IP Address’,
‘txn_id’ => ‘69X18763P7441522C’,
‘payment_type’ => ‘instant’,
‘last_name’ => ‘K’,
‘receiver_email’ => '
@premium23.com’,
‘payment_fee’ => ‘0.01’,
‘receiver_id’ => ‘JWTVNPUQLP3JN’,
‘txn_type’ => ‘subscr_payment’,
‘item_name’ => ‘Description’,
‘mc_currency’ => ‘USD’,
‘item_number’ => ‘1’,
‘residence_country’ => ‘CA’,
‘transaction_subject’ => ‘Description’,
‘payment_gross’ => ‘0.01’,
‘ipn_track_id’ => ‘ac4e0509b4d2a’,
‘option_selection’ => ‘premium23.com’,
‘option_name’ => ‘Originating Domain’,
‘optimizemember_log’ =>
array (
0 => ‘IPN received on: Wed Dec 26, 2018 6:14:11 am UTC’,
1 => ‘optimizeMember POST vars verified through a POST back to PayPal.’,
2 => ‘optimizeMember originating domain ($_SERVER["HTTP_HOST"]) validated.’,
3 => ‘optimizeMember txn_type identified as ( subscr_payment|recurring_payment ).’,
4 => ‘Sleeping for 15 seconds. Waiting for a possible ( subscr_signup|subscr_modify|recurring_payment_profile_created ).’,
5 => ‘Awake. It’s Wed Dec 26, 2018 6:14:26 am UTC. optimizeMember txn_type identified as ( subscr_payment|recurring_payment ).’,
6 => ‘Updated Payment Times for this Member.’,
7 => ‘Payment Notification URLs have been processed.’,
),
‘subscr_gateway’ => ‘paypal’,
‘subscr_baid’ => ‘I-4E7NLGC87HKT’,
‘subscr_cid’ => ‘I-4E7NLGC87HKT’,
‘level’ => ‘1’,
‘ccaps’ => NULL,
‘ip’ => ‘187.160.10.84’,
‘currency’ => ‘USD’,
‘currency_symbol’ => ‘$’,
)

------------- VARNISH ENABLED -------------

LOG ENTRY: Wed Dec 26th, 2018 @ precisely 6:20 am UTC
PHP v7.2.12-1+0~20181112102353.11+jessie~1.gbp55f215 :: WordPress v5.0.2 :: optimizeMember v1.2.9 :: optimizeMember Pro v1.2.9
Memory 19.72 MB :: Real Memory 22.00 MB :: Peak Memory 19.80 MB :: Real Peak Memory 22.00 MB
premium23.com/?optimizemember_paypal_notify=1
User-Agent: PayPal IPN ( paypal.com/ipn )
array (
‘txn_type’ => ‘subscr_cancel’,
‘subscr_id’ => ‘I-4E7NLGC87HKT’,
‘last_name’ => ‘K’,
‘option_selection1’ => ‘premium23.com’,
‘option_selection2’ => ‘187.160.10.84’,
‘residence_country’ => ‘CA’,
‘mc_currency’ => ‘USD’,
‘item_name’ => ‘Description’,
‘amount1’ => ‘0.01’,
‘business’ => ‘@premium23.com’,
‘amount3’ => ‘0.01’,
‘recurring’ => ‘1’,
‘verify_sign’ => ‘AdTgYG6bSOxr.Fy3jXE2r2MgkNLlAbdWevwD7ZJ.mVpF0wYRzxKcaJ1s’,
‘payer_status’ => ‘unverified’,
‘payer_email’ => ‘testpay@premium23.com’,
‘first_name’ => ‘leo’,
‘receiver_email’ => '
@premium23.com’,
‘payer_id’ => ‘HXZ45GQGX37R6’,
‘option_name1’ => ‘Originating Domain’,
‘invoice’ => ‘5c231b82de274~187.160.10.84’,
‘option_name2’ => ‘Customer IP Address’,
‘reattempt’ => ‘1’,
‘item_number’ => ‘1’,
‘subscr_date’ => ‘22:20:35 Dec 25, 2018 PST’,
‘custom’ => ‘premium23.com’,
‘charset’ => ‘windows-1252’,
‘notify_version’ => ‘3.9’,
‘period1’ => ‘1 D’,
‘mc_amount1’ => ‘0.01’,
‘period3’ => ‘1 M’,
‘mc_amount3’ => ‘0.01’,
‘ipn_track_id’ => ‘e3661a0d82b2’,
‘option_selection’ => ‘premium23.com’,
‘amount’ => ‘0.01’,
‘option_name’ => ‘Originating Domain’,
‘period’ => ‘1 D’,
‘mc_amount’ => ‘0.01’,
‘optimizemember_log’ =>
array (
0 => ‘IPN received on: Wed Dec 26, 2018 6:20:41 am UTC’,
1 => ‘optimizeMember POST vars verified through a POST back to PayPal.’,
2 => ‘optimizeMember originating domain ($_SERVER["HTTP_HOST"]) validated.’,
3 => ‘optimizeMember txn_type identified as ( subscr_cancel|recurring_payment_profile_cancel|mp_cancel ).’,
4 => ‘Auto-EOT Time for this account: Fri Dec 28, 2018 6:14 am UTC’,
),
‘subscr_gateway’ => ‘paypal’,
‘subscr_baid’ => ‘I-4E7NLGC87HKT’,
‘subscr_cid’ => ‘I-4E7NLGC87HKT’,
‘level’ => ‘1’,
‘ccaps’ => NULL,
‘ip’ => ‘187.160.10.84’,
)

LOG ENTRY: Wed Dec 26th, 2018 @ precisely 6:21 am UTC
PHP v7.2.12-1+0~20181112102353.11+jessie~1.gbp55f215 :: WordPress v5.0.2 :: optimizeMember v1.2.9 :: optimizeMember Pro v1.2.9
Memory 19.34 MB :: Real Memory 22.00 MB :: Peak Memory 19.79 MB :: Real Peak Memory 22.00 MB
premium23.com/?optimizemember_paypal_notify=1
User-Agent: PayPal IPN ( paypal.com/ipn )
array (
‘txn_type’ => ‘subscr_signup’,
‘subscr_id’ => ‘I-DCC5A5X825YA’,
‘last_name’ => ‘K’,
‘option_selection1’ => ‘premium23.com’,
‘option_selection2’ => ‘187.160.10.84’,
‘residence_country’ => ‘CA’,
‘mc_currency’ => ‘USD’,
‘item_name’ => ‘Description’,
‘amount1’ => ‘0.02’,
‘business’ => ‘@premium23.com’,
‘amount3’ => ‘0.01’,
‘recurring’ => ‘0.01’,
‘verify_sign’ => ‘AeifWJ2-T1tb26Vm0hAbD95-XYPpACWbJhLaJUg6OHSjxJ3BQ-mX9Mwg’,
‘payer_status’ => ‘unverified’,
‘payer_email’ => ‘testpay@premium23.com’,
‘first_name’ => ‘leo’,
‘receiver_email’ => '
@premium23.com’,
‘payer_id’ => ‘HXZ45GQGX37R6’,
‘option_name1’ => ‘Originating Domain’,
‘invoice’ => ‘5c231dcbd70de~187.160.10.84’,
‘option_name2’ => ‘Customer IP Address’,
‘reattempt’ => ‘1’,
‘item_number’ => ‘1’,
‘subscr_date’ => ‘22:21:35 Dec 25, 2018 PST’,
‘custom’ => ‘premium23.com’,
‘charset’ => ‘windows-1252’,
‘notify_version’ => ‘3.9’,
‘period1’ => ‘1 D’,
‘mc_amount1’ => ‘0.02’,
‘period3’ => ‘1 M’,
‘mc_amount3’ => ‘0.01’,
‘ipn_track_id’ => ‘3ed1fb2ce4c58’,
‘option_selection’ => ‘premium23.com’,
‘amount’ => ‘0.02’,
‘option_name’ => ‘Originating Domain’,
‘period’ => ‘1 D’,
‘mc_amount’ => ‘0.02’,
‘optimizemember_log’ =>
array (
0 => ‘IPN received on: Wed Dec 26, 2018 6:21:48 am UTC’,
1 => ‘optimizeMember POST vars verified through a POST back to PayPal.’,
2 => ‘optimizeMember originating domain ($_SERVER["HTTP_HOST"]) validated.’,
3 => ‘optimizeMember txn_type identified as ( web_accept|subscr_signup ).’,
4 => ‘optimizeMember txn_type identified as ( web_accept|subscr_signup ) w/o update vars.’,
5 => ‘Signup Confirmation Email sent to: “leo K” testpay@premium23.com.’,
6 => ‘Storing IPN signup vars now. These are associated with a User’s account record; for future reference.’,
),
‘subscr_gateway’ => ‘paypal’,
‘subscr_baid’ => ‘I-DCC5A5X825YA’,
‘subscr_cid’ => ‘I-DCC5A5X825YA’,
‘level’ => ‘1’,
‘ccaps’ => NULL,
‘eotper’ => NULL,
‘ip’ => ‘187.160.10.84’,
‘initial_term’ => ‘1 D’,
‘initial’ => ‘0.02’,
‘regular’ => ‘0.01’,
‘regular_term’ => ‘1 M’,
‘currency’ => ‘USD’,
‘currency_symbol’ => ‘$’,
)

LOG ENTRY: Wed Dec 26th, 2018 @ precisely 6:21 am UTC
PHP v7.2.12-1+0~20181112102353.11+jessie~1.gbp55f215 :: WordPress v5.0.2 :: optimizeMember v1.2.9 :: optimizeMember Pro v1.2.9
Memory 18.25 MB :: Real Memory 10.00 MB :: Peak Memory 18.36 MB :: Real Peak Memory 10.00 MB
premium23.com/?optimizemember_paypal_notify=1
User-Agent: PayPal/AUHD-214.0-50275941
array (
‘optimizemember_log’ =>
array (
0 => ‘Unable to verify $_POST vars. This is most likely related to an invalid configuration of optimizeMember, or a problem with server compatibility.’,
1 => ‘array (
‘optimizemember_paypal_notify’ => ‘1’,
)’,
),
)

LOG ENTRY: Wed Dec 26th, 2018 @ precisely 6:22 am UTC
PHP v7.2.12-1+0~20181112102353.11+jessie~1.gbp55f215 :: WordPress v5.0.2 :: optimizeMember v1.2.9 :: optimizeMember Pro v1.2.9
Memory 19.52 MB :: Real Memory 4.00 MB :: Peak Memory 19.80 MB :: Real Peak Memory 4.00 MB
premium23.com/?optimizemember_paypal_notify=1
User-Agent: PayPal IPN ( paypal.com/ipn )
array (
‘mc_gross’ => ‘0.02’,
‘invoice’ => ‘5c231dcbd70de~187.160.10.84’,
‘protection_eligibility’ => ‘Eligible’,
‘payer_id’ => ‘HXZ45GQGX37R6’,
‘payment_date’ => ‘22:21:40 Dec 25, 2018 PST’,
‘payment_status’ => ‘Completed’,
‘charset’ => ‘windows-1252’,
‘first_name’ => ‘leo’,
‘option_selection1’ => ‘premium23.com’,
‘option_selection2’ => ‘187.160.10.84’,
‘mc_fee’ => ‘0.02’,
‘notify_version’ => ‘3.9’,
‘subscr_id’ => ‘I-DCC5A5X825YA’,
‘custom’ => ‘premium23.com’,
‘payer_status’ => ‘unverified’,
‘business’ => ‘@premium23.com’,
‘verify_sign’ => ‘AjXWjW9aUZUI3GhAL4bsdrmrQYG7AGkuQbGHuiRLiAj0RquD9XNFuC5y’,
‘payer_email’ => ‘testpay@premium23.com’,
‘option_name1’ => ‘Originating Domain’,
‘option_name2’ => ‘Customer IP Address’,
‘txn_id’ => ‘6T068886GK3218143’,
‘payment_type’ => ‘instant’,
‘last_name’ => ‘K’,
‘receiver_email’ => '
@premium23.com’,
‘payment_fee’ => ‘0.02’,
‘receiver_id’ => ‘JWTVNPUQLP3JN’,
‘txn_type’ => ‘subscr_payment’,
‘item_name’ => ‘Description’,
‘mc_currency’ => ‘USD’,
‘item_number’ => ‘1’,
‘residence_country’ => ‘CA’,
‘transaction_subject’ => ‘Description’,
‘payment_gross’ => ‘0.02’,
‘ipn_track_id’ => ‘3ed1fb2ce4c58’,
‘option_selection’ => ‘premium23.com’,
‘option_name’ => ‘Originating Domain’,
‘optimizemember_log’ =>
array (
0 => ‘IPN received on: Wed Dec 26, 2018 6:22:01 am UTC’,
1 => ‘optimizeMember POST vars verified through a POST back to PayPal.’,
2 => ‘optimizeMember originating domain ($_SERVER["HTTP_HOST"]) validated.’,
3 => ‘optimizeMember txn_type identified as ( subscr_payment|recurring_payment ).’,
4 => ‘Sleeping for 15 seconds. Waiting for a possible ( subscr_signup|subscr_modify|recurring_payment_profile_created ).’,
5 => ‘Awake. It’s Wed Dec 26, 2018 6:22:16 am UTC. optimizeMember txn_type identified as ( subscr_payment|recurring_payment ).’,
6 => ‘Skipping this IPN response, for now. The Subscr. ID is not associated with a registered Member.’,
7 => ‘Re-generating. This IPN will go into a Transient Queue; and be re-processed during registration.’,
),
‘subscr_gateway’ => ‘paypal’,
‘subscr_baid’ => ‘I-DCC5A5X825YA’,
‘subscr_cid’ => ‘I-DCC5A5X825YA’,
‘level’ => ‘1’,
‘ccaps’ => NULL,
‘ip’ => ‘187.160.10.84’,
‘currency’ => ‘USD’,
‘currency_symbol’ => ‘$’,
)

Thanks for doing those.

I notice that some entries are for creating a new account. Varnish wasn’t giving you a problem with those, was it?

The test with and without Varnish should be the same, so that Varnish is the only difference between them and we’re not comparing apples to oranges.

If you want to test a new signup, then test that in both, making sure you’re not logged in to WordPress when you load the page with the payment button/form.

If you want to test upgrading an existing user, then make sure you are logged in to the test user account when you load that payment page. Different accounts for each test.

Thanks!

The process was always for creating a new user account after payment.

There is no upgrade feature for existing customers :slight_smile:

Also, stripe payments doesn’t have this issue (works smoothly).

It’s strictly a paypal issue/varnish cookie stripping issue.

Gotcha, thanks for clarifying that.

So you were always logged out of WP when you loaded the payment page before each test, correct?

It wasn’t upgraded automatically… I guess you tried registration from the page where you landed, then. You don’t have the same issue with the registration link sent to your email, right?

Each test is performed incognito.

After the client is redirected from paypal back to the site, they land on /thank-you/ which has a “register now” button, leading to:

/wp-login.php?action=register

They register, and their account signup info is sent without issue by email.

At this point, their newly created account is simply not upgraded with the session info from paypal.

As a side note, I added the following to my varnish exceptions:

url: wp-login.php
cookie: optimizemember_paypal_return
cookie: optimizemember_paypal_return_tra
cookie: sig

Still no luck.

I see.

I do think it is a cookie issue. s2Member sets a cookie when the user is returned from the payment. On registration, s2Member checks for this cookie and sets the user level accordingly.

What I’d do to be on the safe side, would be to add a message in the thank-you page, where the person is instructed to look for the email with the registration link in his inbox.

With Stripe you’re not having the issue because that integration uses the pro-form, which registers the user as well as process the payment.

What PayPal service are you using? PayPal Standard buttons?

Just verified that the entries for both in gateway-core-rtn.log, show that the cookie was set, so s2Member is doing its job there.

5 => ‘Registration Cookies set on ( web_accept|subscr_signup|subscr_payment ) w/o update vars.’,
6 => ‘Transient Tracking Cookie set on ( web_accept|subscr_signup|subscr_payment ) w/o update vars.’,

Is that a settings file? Can I see it? Send it in a private message, so it’s not public.

Hey Clavaque, apologies for the delay.

It’s simply an input field on my webhost: cloudways:

I have added a few more entries into the exceptions (based on what you pointed out).

Edit:

Just tested it again…

Still no luck

Thanks for the update. I’ll have to study this a bit more.