Zencart Version : 1.5.4
Server : Amazon ZWS Lightsail
OS : Linux
PHP Version : 5.6.40
Hi Experts
We are facing a very different kind of issue on my website. Some customers are complaining that they are not able to place the orders as when they make the payment, the amount is deducted but on returning back to the website it shows
"Whoops! Your session has expired.
If you were placing an order, please login and your shopping cart will be restored. You may then go back to the checkout and complete your final purchases.
If you had completed an order and wish to review it, or had a download and wish to retrieve it, please go to your My Account page to view your order."
Then i tried it myself and after lot of testing I found that the issue is there on 2 of 3 of my payment gateway (Paytm and Payu) and not on Paypal. It occurs for some users (including me) who are using google chrome (not all of them) including me.
Please also note the following points:
i) It occurs if I stay on the payments page for exactly more than 1 minute
ii) I have received all complaints from Google Chrome
iii) On Paypal, this issue is not seen but only on PayTM and PAyu Payment Gateways
iv) I see that the some session parameters related to customer are missing when it comes back after 1 minute and hence due to the below condition on /includes/modules/checkout_process.php the parameter customer_id is missing from session and hence, it is getting redirected to the timeout page.
PHP Code:
// if the customer is not logged on, redirect them to the time out page
if (!$_SESSION['customer_id']) {
zen_redirect(zen_href_link(FILENAME_TIME_OUT));
} else {
// validate customer
if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
$_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_SHIPPING));
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}
}
v) Below are the session parameter if i press back button before 1 minute and after 1 minute:
Before 1 minute:
PHP Code:
array(39) { ["securityToken"]=> string(32) "c2433696283beec7edb06bc0c3e2fd10" ["customers_host_address"]=> string(52) "abts-north-dynamic-170.132.69.182.airtelbroadband.in" ["cartID"]=> string(5) "58868" ["cart"]=> object(shoppingCart)#5 (12) { ["contents"]=> array(1) { [24016]=> array(1) { ["qty"]=> string(1) "1" } } ["total"]=> float(425) ["weight"]=> int(0) ["cartID"]=> string(5) "58868" ["content_type"]=> string(8) "physical" ["free_shipping_item"]=> int(1) ["free_shipping_weight"]=> int(0) ["free_shipping_price"]=> float(425) ["download_count"]=> int(0) ["total_before_discounts"]=> float(425) ["display_debug_messages"]=> bool(false) ["flag_duplicate_msgs_set"]=> bool(false) } ["language"]=> string(7) "english" ["languages_id"]=> string(1) "1" ["languages_code"]=> string(2) "en" ["check_valid"]=> string(4) "true" ["navigation"]=> object(navigationHistory)#16 (2) { ["path"]=> array(1) { [0]=> array(4) { ["page"]=> string(16) "checkout_process" ["mode"]=> string(3) "SSL" ["get"]=> string(0) "" ["post"]=> array(0) { } } } ["snapshot"]=> array(0) { } } ["currency"]=> string(3) "INR" ["today_is"]=> string(10) "2020-07-19" ["updateExpirations"]=> bool(true) ["session_counter"]=> bool(true) ["customers_ip_address"]=> string(14) "182.69.132.170" ["customer_id"]=> string(5) "25084" ["customer_default_address_id"]=> string(5) "61180" ["cart_address_id"]=> string(5) "61180" ["sendto"]=> string(5) "61180" ["customers_authorization"]=> string(1) "0" ["customer_first_name"]=> string(7) "Harshit" ["customer_last_name"]=> string(9) "Chowdhary" ["customer_country_id"]=> string(2) "99" ["customer_zone_id"]=> string(3) "312" ["valid_to_checkout"]=> bool(true) ["cart_errors"]=> string(0) "" ["payment"]=> string(12) "paywithpaytm" ["cart_country_id"]=> string(2) "99" ["country_info"]=> array(3) { ["countries_name"]=> string(5) "India" ["countries_iso_code_2"]=> string(2) "IN" ["countries_iso_code_3"]=> string(3) "IND" } ["shipping_weight"]=> int(0) ["total_weight"]=> int(0) ["total_count"]=> int(1) ["receive_firstname"]=> string(7) "Harshit" ["billto"]=> string(5) "61180" ["send_firstname"]=> string(7) "Harshit" ["shipping"]=> array(3) { ["id"]=> string(23) "freeshipper_freeshipper" ["title"]=> string(35) "FREE SHIPPING! (No Delivery Charge)" ["cost"]=> float(0) } ["comments"]=> string(0) "" ["dropdown"]=> string(3) "( )" ["sorderid"]=> string(18) "ORDR_5f146aa00a2cd" ["category_tree"]=> object(SimpleCategoriesTree)#44 (8) { ["category_tree"]=> array(1057) { [811]=> array(9) { ["name"]=> string(14) "All Time Gifts" ["image"]=> NULL ["description"]=> string(57) "
After 1 minute
PHP Code:
array(15) { ["securityToken"]=> string(32) "82ef3986fde32ff13d558ace6ac34740" ["customers_host_address"]=> string(52) "abts-north-dynamic-170.132.69.182.airtelbroadband.in" ["cartID"]=> string(0) "" ["cart"]=> object(shoppingCart)#5 (11) { ["contents"]=> array(0) { } ["total"]=> int(0) ["weight"]=> int(0) ["content_type"]=> bool(false) ["free_shipping_item"]=> int(0) ["free_shipping_weight"]=> int(0) ["free_shipping_price"]=> int(0) ["download_count"]=> int(0) ["total_before_discounts"]=> int(0) ["display_debug_messages"]=> bool(false) ["flag_duplicate_msgs_set"]=> bool(false) } ["language"]=> string(7) "english" ["languages_id"]=> string(1) "1" ["languages_code"]=> string(2) "en" ["check_valid"]=> string(4) "true" ["navigation"]=> object(navigationHistory)#28 (2) { ["path"]=> array(1) { [0]=> array(4) { ["page"]=> string(16) "checkout_process" ["mode"]=> string(3) "SSL" ["get"]=> string(0) "" ["post"]=> array(0) { } } } ["snapshot"]=> array(0) { } } ["currency"]=> string(3) "INR" ["today_is"]=> string(10) "2020-07-19" ["updateExpirations"]=> bool(true) ["category_tree"]=> object(SimpleCategoriesTree)#8 (8) { ["category_tree"]=> array(1057) { [811]=> array(9) { ["name"]=> string(14) "All Time Gifts" ["image"]=> NULL ["description"]=> string(57) "
Request someone to kindly help. I am stuck completely here.
Regards
Harshit
Bookmarks