So I'm revisiting this issue as my website is picking up more activity and I'm getting an increasing number of customers complaining that they get session timed out during the final phase of the checkout process which also begins to throw them into a log-in loop (whereby they attempt to log in after the session timeout message repeatedly and it does not appear to log them into the website).
I've sat down and really tried to drill down the source of the issue, so I checked out the cc slamming code in checkout_process.php and I see the function which you are referring to, Dr. Byte, but I no longer believe that this is the reason behind most of my customer session timeouts. The code only sets the payment_attempt variable to zero and iterates it by 1 once a credit card number is actually inputted in an accepted format (i.e. 16 total digits for a Visa number, etc) and the payment info was actually forwarded to the financial institution for processing. For example, I use PayPal website payments pro, and a customer correctly inputs their cc number but puts the wrong cvc code. Then payment_attempt iterates by 1, and after 3 more unsuccessful tries, the session is forced timed out and, most importantly to note, the shopping cart contents are destroyed and I get an email via PayPal notifying me of each unsuccessful payment attempt that was made. So other types of incorrect CC entries (such as forgetting to type a digit so the customer only typed 15 or doubletyped a digit for a total of 17) don't count as payment attempts that trigger the credit card slamming.
I've tested and seen the iteration of payment_attempts by inserting this code to display the number of checkout attempts in the tpl_checkout_stacked.php file:
echo "Checkout Attempt Number {$_SESSION['payment_attempt']}
So on the checkout confirmation page, I can see the live count going up when credit card numbers are actually submitted to PayPal for processing attempt that fails, and the counter stay stagnant when Zen-Cart detects that the credit card number is not even a valid format to begin with.
I know you know all this already, Dr. Byte, but the reason why I'm pointing this all out to you is because, for all of my customers who have so far notified me of their difficulties in checking out because they get session timed out when they hit the button to "confirm order", the important things I've noticed is that I did not receive PayPal emails for any of those specific customers indicating that they had attempted to pay unsuccessfully a few times beforehand, and also because, their shopping cart contents are fully intact and not destroyed. So I'm arriving at the conclusion that these session timeouts are not being triggered by the slamming code.
I can only sporadically reproduce this issue, so I'm having a very difficult time figuring out what sequence of actions causes this particular behavior by Zen-Cart.
I've looked at other sources of session timeout issues, such as Suhosin, and I've contacted my webhost. We reviewed the phpinfo of my server, and suhosin encrypt sessions is set to OFF both locally and globally.
From my observations, it appears that there is some kind of session mismatching occurring (I'm sorry if i'm not describing this correctly, as I'm very limited in my knowledge of php)...but right when the session timeout occurs when I hit the button to "confirm order", a zenid is attached to the end of the webaddress in the web browser's bar (which I know is normal and expected) and it's basically impossible for me to log in again on consecutive attempts, and each attempt that I'm making, attaches a new randomly generated zenid code to the end of the webaddress. This leads me to believe that the cookie session for my account is still active in the web browser's cache, but for some reason Zen-Cart is not in "sync" with that session cookie and so my web browser tries to create a new session, but needs to do so using the method of attaching a zenid to the web address. But since from the serverside, I still appear to be logged in, zen-cart won't allow me to successfully log into my account, hence a login loop occurs? It's almost the same symptom as when I log into my account from Chrome browser, then while that's still active, I try to log into my account with IE...obviously I can't and shouldn't be able to log in twice with the same account.
The only definitive way for me to successfully log back in is to close my web browser, then reopen it, and log in, and my shopping cart contents are intact (which again is what makes me believe it's not the cc slamming code causing the timeouts).
I hope my explanation and logic somewhat makes sense, and if not I apologize, but everything else I explained about how the session timeouts occur are accurate.
The nature of my store is that I am wholesale, and so my customers spend a good deal of time building their shopping carts before checking out, so yes, I know session timeouts can occur due to possible inactivity, but those timeouts should occur right at that moment that 20 minutes of idle time has occurred and not specifically on the order confirmation page, right? I know and understand the simple workaround is to let my customers know to close their web browser and try again, but it's disconcerting to the enduser for them to submit their payment information and then it throws them a session timeout message, because at that point, it's very unclear to them if the payment was actually processed. I'd rather really try to fix this solution rather than work around it.
If you have any suggestions for me to turn on any kind of logs to debug the issue, or have any additional ideas as to what might be causing these timeouts during order confirmation, I would greatly appreciate it! Meanwhile I will try to keep trying different things to narrow down the specific behavior that causes Zen-cart to time out like this. Thanks!


Reply With Quote

