Forums / PayPal Website Payments Pro support / Whoops! Your session has expired.

Whoops! Your session has expired.

Views: 21,449

Results 1 to 20 of 24
28 Mar 2012, 10:52 AM
#1
robophung avatar

robophung

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Whoops! Your session has expired.

Hello,

So I've been running tests with dummy orders on WPP which was newly implemented in my store, and once in a while, I was hit with session timeout issues while checking out and submitting my cc for payment. I didn't think anything of it at the time, but now, several of my customers have contacted me about issues with checking out and the symptoms that they describe sound the same...

I've been running more tests and I can duplicate the issue very consistently on my store.

Basically, to trigger the session timeout.

-Log into my account.
-Add items to shopping cart.
-Initiate checkout.
-Input an incorrect cc number the first time around... and receive an invalid cc number message from the messagestack...
-Input the corrected cc number the 2nd time around, and hit confirm order.

Immediately, I am hit with a session timeout, and have to log in again. Sometimes this happens in a loop, and relogging in and attempting to check out results in in more session timeouts.

Multiple consecutive session timeouts seem to be the common thing with my customers who contacted me about having problems, as well.

While I can't be for certain that this is the only way to trigger the session timeout, I am sure this is one way to consistently trigger it...

My installed mods are...

Stock by Attributes
Product Attribute Grid
Google analytics
SitemapXML
Super Orders
Ty Package Tracker
QueryCache

These are the mods that have been in place when I noticed the session timeout issues.

I have installed more mods since then:

FEC
Maxmind
Ceon URI

Is anyone else having these same problems when they follow these steps above? Or does anyone know of a solution? Thanks in advance.

28 Mar 2012, 11:03 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Whoops! Your session has expired.

There is a built-in "credit card slamming detection" system which logs the customer out after 6 failed attempts. This is intended to thwart attempts at testing stolen card numbers.
Most legitimate customers are savvy enough to correctly enter their payment details in less than 6 tries. The only other time I've seen this tripped is when writing a new payment module and testing it over and over again ... which of course is exactly the sort of thing the detection is designed to stop in a real live store such as yours.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

26 Aug 2012, 3:52 AM
#3
robophung avatar

robophung

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Whoops! Your session has expired.

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!

26 Aug 2012, 4:25 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Whoops! Your session has expired.

Given the updated information about the symptoms you're encountering, I agree with you that it's not the CC slamming detection that's causing it.

And while several things you said about session stuff are not fully accurate, you are correct that there's some mismatch happening between the session data in the store vs in the customer's browser, hence the logout.

A detailed list of your addons/customizations, especially but not limited to things related to checkout, will be helpful. (see the Posting Tips window when you click Reply below).
And turning on PayPal Debug Logging would be helpful too: http://www.zen-cart.com/showthread.php?61199-Debug-Logging-PayPal

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 Aug 2012, 7:46 AM
#5
robophung avatar

robophung

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Whoops! Your session has expired.

Hi Dr. Byte,

So I have the following mods:

Admin Login as Customer
Ceon URI Mapping
Maxmind
QueryCache
Fast and Easy Checkout
Product Attribute Grid
Stock by Attributes
Quantity Discounts
Super Orders
Ty Package Tracker
SiteMapXML
Google Analytics

I'm currently running PHP 5.3 in FastCGI mode.

I'm using a nonshared secured certificate, and my sessions are configured to run in database mode.

Here are my sessions configuration in the admin:

Cookie Domain- True
Force Cookie Use- False
Check SSL Session ID- False
Check User Agent- False
Check IP Address- False
Prevent Spider Sessions- True
Recreate Session- True
IP to Host Conversion Status- true
Use root path for cookie path- False
Add period prefix to cookie domain- True

I began by switching my website to 5.3 CGI instead of FastCGI...not sure if that might help, but so far, I have not been able to trigger the session timeout.

If I can successfully get the checkout process to timeout, my guess is the addon that i have to start off with isolating as a potential cause of this behavior by Zen-Cart is FEC?

I've turned on the PayPal logs, but nothing to report as of yet...Any additional input or help you can offer would be greatly appreciated it. Thank you so much!

28 Aug 2012, 6:58 PM
#6
robophung avatar

robophung

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Whoops! Your session has expired.

Ok so I believe I've pinpointed the exact cause of the problem.

So basically, if i am logged in as a customer, and at any point during my session while building my shopping cart, if I go idle and I am timed out...once I log back in, everything appears fine and I can continue to shop, but the moment I attempt to check out, and hit the final button to "confirm order" I get thrown into a session timeout loop.

So somehow there is some kind of mismatch or disconnect between client session and server session in this particular situation right when submitting payment information for processing.

This also explains why I'm hitting an unusual number of customers complaining to me about this issue, since my store format is wholesale and customers can potentially load their shopping cart up with numerous products, they can take up to an hour or more to build and finalize their shopping cart. There is a high probability that they might go afk at some point during their shopping and come back to find themselves logged out, but when they log back in to continue shopping and checkout, the session timeout loop occurs.

The problem seems to be resolved only when closing the web browser entirely and reopening it, logging in, and attempting checkout again.

I tested this both on IE9 and chrome and the same thing occurs.

I am not sure if this issue exists in vanilla 1.3.9h without any additional modules added in, as I have not had the time to run further tests into that much detail. I'll roll back an earlier backup of my store into a test subdomain and try to see if this issue still exists, as soon as I can but Dr. Byte, if you have a test server all set up already, and handy to test this scenario out, perhaps you can help me run a quick test on this scenario at your convenience? Thank you so much for all the assistance you provide on a daily basis to everyone.

2 Sep 2012, 12:48 AM
#7
robophung avatar

robophung

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Whoops! Your session has expired.

So my webhost changed some security settings on their end (the details of which I am not sure of), and that appears to have resolved my session timeout issues in my specific scenario. Everything's working great now. Problem solved!

2 Sep 2012, 12:49 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Whoops! Your session has expired.

RoboPhung:

So my webhost changed some security settings on their end (the details of which I am not sure of), and that appears to have resolved my session timeout issues in my specific scenario. Everything's working great now. Problem solved!

Any chance you can drag those details out of them? It might be quite helpful for others in the future.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Sep 2012, 8:53 AM
#9
robophung avatar

robophung

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Whoops! Your session has expired.

I had spoken too soon about what I thought was the solution...as the problem crept up again, and I was able to trigger it.

I messed around in my admin and changed "check ssl session id" to true (that being the only change) and so far it also seems to be holding up, and passing all my attempts to trigger the timeouts...but I'll need to test more comprehensively before preemptively suggesting that it's a working solution.

8 Sep 2012, 5:24 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Whoops! Your session has expired.

It would be rare for that to be the "fix".

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Sep 2012, 4:09 PM
#11
dochsa avatar

dochsa

New Zenner

Join Date:
Apr 2008
Location:
United Kingdom
Posts:
62
Plugin Contributions:
0

Re: Whoops! Your session has expired.

Hi All I am suddenly having the same issue. Evenytime I click on Checkout, the session seems to time out? Any help is appreciated. This has happened over night and Im unsure as to what has happened.

Site: www.assceneon.com/catalog

Donovan

28 Jan 2013, 9:03 AM
#12
gerrythemole avatar

gerrythemole

New Zenner

Join Date:
Dec 2008
Posts:
57
Plugin Contributions:
0

Re: Whoops! Your session has expired.

I have had this issue with 1.3.9h and the Cardsave module from Ceon. I found the slamming code and it is actually set to THREE attempts not SIX. (I have checked the 1.5.1 code and the same applies). BUT!! and like me it's a big but! If you encounter 3d (secured by visa or whatever you know it as) the attempt count halves. You now have 1.5 attempts so you make 1 mistake - and people do - and when you try the 3d secure second time you have already used you full quota. By upping the attempt count to SIX I then find I get a genuine 3 attempts with 3d but, obviously, six without 3d.

25 Feb 2013, 8:31 PM
#13
indyneal avatar

indyneal

New Zenner

Join Date:
Nov 2011
Location:
Indianapolis, IN
Posts:
7
Plugin Contributions:
0

Re: Whoops! Your session has expired.

I am having the exact problems that RoboPhung described. Version 1.51

Just wanted to follow up and see if he's still here and to confirm that his fix worked.

I messed around in my admin and changed "check ssl session id" to true (that being the only change) and so far it also seems to be holding up, and passing all my attempts to trigger the timeouts...but I'll need to test more comprehensively before preemptively suggesting that it's a working solution.

27 Feb 2013, 8:13 PM
#14
robophung avatar

robophung

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Whoops! Your session has expired.

IndyNeal:

I am having the exact problems that RoboPhung described. Version 1.51

Just wanted to follow up and see if he's still here and to confirm that his fix worked.

No, it's not a fix. You should probably leave it the way it is by default.

I also don't believe it's a session mismatch causing it either, but rather something in the actual code that's making a specific call to kill the session due to the data received back from PayPal at the time the credit card information is sent to be verified.

You should be certain of a few things however, before you can be certain that you have this same issue that I've been experiencing. There are several other things that can cause session timeouts which is normal and not considered a bug.

  1. This is not the normal credit card slamming protection that is built into the code. The default is 3 attempts to submit payment, but for the slamming detection to actually be triggered, the payment attempt must have reached all the way to the confirmation page. And if you turned on email debugging notification in the paypal pro payments module settings, you will receive an email for each time the attempt failed. After 3, the session is killed, the customer receives the "Whoops, session timed out" message screen, and their shopping cart contents are completely destroyed.

  2. Your webhost's mysql session timeouts are typically set as default at 20 minutes. If the customer is logged in and happen to let their pc idle for 20 minutes or more and come back to try to continue shopping or make their payment, the session is timed out, and they also get a whoops message. It's hard to predict customer behavior, but you'd be surprised at how many people leave their computers for 20 minutes at the checkout screen and then come back to submit their payment and panic because they're not sure if the credit card was actually processed or not. I get several customers who contact me about this each month. You might want to contact your webhost to have them set the timeout at a longer period than 20 minutes if that is the main source of your problem.

The specific issue I had was that none of the above two were met, but in some situations where the customer was in the process of checking out, they may have inputted the wrong credit card number on a few attempts (i.e., inputting 15 digits instead of 16, or misstyped their credit card number) and when it reaches the 3rd checkout, hitting the "confirm order" button immediately logs them out and they get hit with the whoops message. I, too, was also able to replicate this issue on my clean upgrade to 1.51, but it was indeed hard for me to replicate the exact set of conditions to do so (I had to enter a completely wrong credit card number maybe 10+ times in a row to get it to tirgger) but I knew it still persisted because I got a few customers who yet again described that they hit the confirm order button and got hit with session timeouts, and were worried about their cc being charged, but I logged into their accounts and their shopping cart contents were not destroyed. This was after I upgraded to 1.51.

So I've narrowed down the code to where a specific function in the paypaldp payment module (for payments pro) makes a call to kill the session depending on the arguments received back from paypal concerning the payment information being submitted, and I disabled that function. Unfortunately, I'm testing this in my live store, since I don't have another spare SSL set up in a test environment, but it looks promising so far. I have not been able to replicate my issue since, granted I have not tested extensively, and payments are still being processed smoothly.

I'm no php expert, but from my limited abilities, I can't see how disabling that function in question would break any feature anyway, and the best litmus so far is that I have not received any customer complaints.

I'm not at my main pc at the moment, so I can't share my findings until I get home. But I'll let you know what i did as soon as i can, and hopefully that will fix your problem too....and also hopefully, someone much more knowledgeable, like Dr. Byte, can chime in and explain if I might have found a fix to the problem, or if the change I made is actually detrimental in some way.

28 Feb 2013, 10:28 AM
#15
robophung avatar

robophung

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Whoops! Your session has expired.

Okay so I traced the issue backwards beginning from where I can see the session timeout error begins. Normally hitting the "confirm order" button would lead us to the checkout success page and the order is inputted into the zen-cart system.

So looking at the "includes\modules\pages\checkout_success\header.php" file, referencing line 16...

if (!$_SESSION['customer_id']) {
  zen_redirect(zen_href_link(FILENAME_TIME_OUT));
}

We get directed to the "Whoops, your session timed out" message when the session customer id variable is UNSET.

Now looking at the "includes\modules\payment\paypaldp.php" file, referencing line 1748...

function ec_delete_user($cid) {
    global $db;
    unset($_SESSION['customer_id']);
    unset($_SESSION['customer_default_address_id']);
    unset($_SESSION['customer_first_name']);
    unset($_SESSION['customer_country_id']);
    unset($_SESSION['customer_zone_id']);
    unset($_SESSION['comments']);
    unset($_SESSION['customer_guest_id']);
  }

You can see that indeed a function exists within this module that UNSETS the customer_id variable of a current customer session...

Now here is the interesting thing about this function -- the comment for the function describes it as follows:

/**

  • If the account was created only for temporary purposes to place the PayPal order, delete it.
    */

I can't think of any scenario where an account could only be temporarily created to place an order using their credit card inputted directly on the zen-cart website (Website Payments Pro method).

There is no possible way for this to happen, the customer must create a permanent account first, unless the zen-cart administrator implemented COWOA for their store?? But that's an entirely different module, which I'm not familiar with at all, and I don't think has anything to do with this particular function in question.

Furthermore, this function only UNSETS most of a session's variables, it doesn't actually delete the customer's account. If you reference the function as it's defined in the PayPal Express payments module (paypalwpp.php), that function definition actually deletes the customer entirely from the zen-cart database in addition to UNSETTing all the session variables. I haven't familiarized myself too much with PayPal express checkout, but I know in the PayPal express checkout module settings we can choose whether or not to automatically create accounts, so I'm assuming that it is indeed possible for customers to shop as guests, check out with PayPal and have their account details destroyed from the zen-cart database after checkout completes. That seems fine and a proper implementation for the flow of a PayPal Express Checkout transaction, but this simply isn't possible when we are talking about Website Payments Pro.

This leads me to believe that this function might just be old deprecated code that carried over somehow, and it does not really have any place in the way the paypaldp.php payment module should function.

Now to further work backwards, I took a look at what other function actually makes a call to "ec_delete_user()". It begins only a few lines down starting at 1770...

if ($kill_sess_vars) {
	  if (!empty($_SESSION['paypal_ec_temp'])) {
        $this->ec_delete_user($_SESSION['customer_id']);
      }
      // Unregister the paypal session variables, making the user start over.
      unset($_SESSION['paypal_ec_temp']);
      unset($_SESSION['paypal_ec_token']);
      unset($_SESSION['paypal_ec_payer_id']);
      unset($_SESSION['paypal_ec_payer_info']);
      unset($_SESSION['paypal_ec_final']);
      unset($_SESSION['paypal_ec_markflow']);
      // debug
      $this->zcLog('termEC-1', 'Killed the session vars as requested');
}

I took a look at exactly how $kill_sess_vars could be defined as 'true' and it comes down to another variable called $gateway_mode being passed to the TerminateEC() function call.

So finally I looked at how $gateway_mode is defined and on line 1801 it is defined as...

$gateway_mode = (isset($response['PNREF']) && $response['PNREF'] != '');

I don't really have any understanding as to what the $response['PNREF'] response code from PayPal means, but I'm presuming that it is indeed possible for that response code to come back as defined which leads to a sequence of functions being executed that eventually leads the customer to the session timeout problem.

My best conjecture is that some specific triggers can lead to the PNREF response code from PayPal to unintentionally come back as not NULL which is the root of this problem, and my workaround was to comment out part of the "ec_delete_user()" function, because, as I had explained above, it doesn't appear as if this function has any place in the implementation of this payment module.

Specifically:

if ($kill_sess_vars) {
      /* Begin RoboPhung Edit
	  if (!empty($_SESSION['paypal_ec_temp'])) {
        $this->ec_delete_user($_SESSION['customer_id']);
      }
	  End RoboPhung Edit */
      // Unregister the paypal session variables, making the user start over.
      unset($_SESSION['paypal_ec_temp']);
      unset($_SESSION['paypal_ec_token']);
      unset($_SESSION['paypal_ec_payer_id']);
      unset($_SESSION['paypal_ec_payer_info']);
      unset($_SESSION['paypal_ec_final']);
      unset($_SESSION['paypal_ec_markflow']);
      // debug
      $this->zcLog('termEC-1', 'Killed the session vars as requested');
    }

So far, this does not appear to have created any issues for my customer's transactions, and I myself, have not been able to trigger any session timeout problems after repeated tests. But of course, and it should go without saying, I should state a disclaimer that you should thoroughly test it out yourself before going "live" with the code change if you have the same problem as me and think that this might help solve it.

1 Mar 2013, 9:39 AM
#16
robophung avatar

robophung

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Whoops! Your session has expired.

Just relooked over my last post and realized that the source of the issue might be the inner nested IF statement of the terminateEC() function...

if ($kill_sess_vars) { 
      if (!empty($_SESSION['paypal_ec_temp'])) { 
        $this->ec_delete_user($_SESSION['customer_id']); 
      } 
      // Unregister the paypal session variables, making the user start over. 
      unset($_SESSION['paypal_ec_temp']); 
      unset($_SESSION['paypal_ec_token']); 
      unset($_SESSION['paypal_ec_payer_id']); 
      unset($_SESSION['paypal_ec_payer_info']); 
      unset($_SESSION['paypal_ec_final']); 
      unset($_SESSION['paypal_ec_markflow']); 
      // debug 
      $this->zcLog('termEC-1', 'Killed the session vars as requested'); 
}  

Specifically, (!empty($_SESSION['paypal_ec_temp'])), paypal_ec_temp is set by the paypal express checkout module. So my assumption is that a customer might begin a PayPal payment, but decide to cancel and return to the checkout page to complete the checkout by credit card instead. And under certain circumstances, whether paypal_ec_temp is assigned as TRUE or FALSE by the paypalwpp express checkout module, it never gets UNSET, so thus (!empty($_SESSION['paypal_ec_temp'])) returns a true value.

I restored the original unmodified paypaldp.php payment module and tested as follows:

Begin a checkout by PayPal, cancel at the PayPal page and get returned to the store. Then proceed to enter an incorrect creditcard number 8 times in a row (not an actual accepted credit card number that actually allows us to reach the confirm order page, but an incorrect creditcard number by which the message stack returns the message: The credit card number entered is invalid. Please check the number and try again.)

Then finally enter the correct credit card information and get hit with a session timeout. So I can confirm that this glitch still exists in 1.51.

I reverted back to the paypaldp.php module with my changes as described in the previous post, and followed the same sequence again, and the order was successfully processed after 8 bad creditcard info attempts.

I know my test scenario is extreme, and it would be unreasonable to expect customers would ever reach those lengths to trigger this session timeout problem, but I know that this glitch does get triggered in live scenarios, as I've encountered in the past, several customers a month would call me and tell me about getting the timeout message when attempting to check out, and assured me that they did not let their PC idle for any lengthy period while shopping. So perhaps it only takes 1-2 incorrect credit card entries and at some point the customer also attempted to checkout by PayPal but decided not to.

Whatever the case may be, like I said, it really does not appear as if ec_delete_user() function has any real meaningful reason to exist in this module, because it's purpose appears to be to log an individual out of their zen-cart session if the account was created only for temporary purposes of placing the order, which is not applicable when a customer decides to pay directly with credit card through website payments pro.

If it can be confirmed as indeed a bug, then perhaps I should look into submitting it in the bug reports forum.

23 May 2013, 9:32 PM
#17
indyneal avatar

indyneal

New Zenner

Join Date:
Nov 2011
Location:
Indianapolis, IN
Posts:
7
Plugin Contributions:
0

Re: Whoops! Your session has expired.

This is SO FRUSTRATING.

I've tried the fixes that RoboPhung has made, seemingly successfully on his site, however we are still experiencing this same problem.

As RoboPhung has with great detail described his problem, ours is pretty much exactly as his.

We are experiencing this with customers about once or twice for every 20 orders or so. It only happens sometimes. I've even gone in an submitted test orders over and over and they'll work, then bam I'll get the "whooops you're session" has timed out. I, personally, have been able to re-log in (after closing browser) and submit an order, however, some customers get caught in a perpetual "whoops" loop where they can not get an order to go through. They call, I log into their account and submit the order with no problem.

The hard part here is that it only happens sometimes. I talk to the customers, they are seemingly not doing anything that should cause the time out to happen. They browse catalog, register go to payment all in just a couple of minutes and they are still "timed out".

All of this happens right at the end at checkout when users submit their orders.

Just like RoboPhung we use Paypal Payments Pro as our merchant provider. Is this a Paypal issue or is this all inside Zencart? As I said, I made the changes RoboPhung did and we still experience with problem.

I'm tempted to set up another merchant account with Authorize.net to see if the problem continues there.

Any other thoughts?

1 Jul 2013, 7:52 PM
#18
zcricardo avatar

zcricardo

New Zenner

Join Date:
Apr 2009
Posts:
15
Plugin Contributions:
0

Re: Whoops! Your session has expired.

I have the same problem. Just upgraded to 1.5.1. If a customer is IDLE for sometime, when trying to checkout they get the Woops! message. The customer has to refresh its cart (adding or deleting a product), then they can continue through the checkout process. I've followed this thread but there is no a specific solution mentioned.

Please help Dr. Byte

1 Jul 2013, 8:04 PM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Whoops! Your session has expired.

ZCricardo:

If a customer is IDLE for sometime
When the customer is idle, a timeout naturally occurs when their session expires. This is not new.
You didn't say what payment method is involved in your scenario, if any.
You also didn't list any of the ways in which your store is different from original ZC code.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

1 Jul 2013, 10:10 PM
#20
zcricardo avatar

zcricardo

New Zenner

Join Date:
Apr 2009
Posts:
15
Plugin Contributions:
0

Re: Whoops! Your session has expired.

DrByte:

When the customer is idle, a timeout naturally occurs when their session expires. This is not new.
You didn't say what payment method is involved in your scenario, if any.
You also didn't list any of the ways in which your store is different from original ZC code.

Ok, the customer is IDLE, but the only way to be able to do the checkout process, even after loggin again, is refreshing the cart as I described. There is no additional code just the 1.5.1 that I downloaded. The client hasn't selected payment method because the message is shown as soon as the customer clicks the checkout button.

In 1.3.8a this was not an issue

Thanks!