Results 1 to 10 of 23

Hybrid View

  1. #1
    Join Date
    Aug 2020
    Location
    Finland
    Posts
    12
    Plugin Contributions
    0

    Default Re: Session expired after some payments instead of checkout_success

    No idea. I do not remember changing it ever. But I tried to put it to False, as it is default. No difference.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,872
    Plugin Contributions
    96

    Default Re: Session expired after some payments instead of checkout_success

    Does the issue occur on all browsers? I've been seeing a lot of timeouts due to the "Samesite" cookie settings on Chrome, but you've got your site setup as 'None, secure' which should be (?) fine.

  3. #3
    Join Date
    Aug 2020
    Location
    Finland
    Posts
    12
    Plugin Contributions
    0

    Default Re: Session expired after some payments instead of checkout_success

    Need to test more on other browsers. Just tried on Safari for more than 10 times, all working.
    SameSite cookies is something new for me. Is it like setting in chrome (just quickly googled it)?
    So if this is the issue, I should update the settings somewhere on my site to SameSite=None; Secure?

    And if it is the issue, can it be random like I have it?

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,872
    Plugin Contributions
    96

    Default Re: Session expired after some payments instead of checkout_success

    Quote Originally Posted by kalm View Post
    Need to test more on other browsers. Just tried on Safari for more than 10 times, all working.
    SameSite cookies is something new for me. Is it like setting in chrome (just quickly googled it)?
    So if this is the issue, I should update the settings somewhere on my site to SameSite=None; Secure?

    And if it is the issue, can it be random like I have it?
    What does your copy of /includes/init_includes/init_sessions.php (around line 43) read? Is it similar to

    Code:
    if (filter_var($cookieDomain, FILTER_VALIDATE_IP)) $domainPrefix = '';
    $secureFlag = ((ENABLE_SSL == 'true' && substr(HTTP_SERVER, 0, 6) == 'https:' && substr(HTTPS_SERVER, 0, 6) == 'https:') || (ENABLE_SSL == 'false' && substr(HTTP_SERVER, 0, 6) == 'https:')) ? TRUE : FALSE;
    
    session_set_cookie_params(0, $path, (zen_not_null($cookieDomain) ? $domainPrefix . $cookieDomain : ''), $secureFlag, TRUE);
    
    /**
     * set the session ID if it exists
     */
    if (isset($_POST[zen_session_name()])) {
      zen_session_id($_POST[zen_session_name()]);
    } elseif ( ($request_type == 'SSL') && isset($_GET[zen_session_name()]) ) {
      zen_session_id($_GET[zen_session_name()]);
    }
    ... or to
    Code:
    if (filter_var($cookieDomain, FILTER_VALIDATE_IP)) $domainPrefix = '';
    $secureFlag = ((ENABLE_SSL == 'true' && substr(HTTP_SERVER, 0, 6) == 'https:' && substr(HTTPS_SERVER, 0, 6) == 'https:') || (ENABLE_SSL == 'false' && substr(HTTP_SERVER, 0, 6) == 'https:')) ? TRUE : FALSE;
    
    $samesite = (defined('COOKIE_SAMESITE')) ? COOKIE_SAMESITE : 'lax';
    if (!in_array($samesite, ['lax', 'strict', 'none'])) $samesite = 'lax';
    
    session_set_cookie_params([
        'lifetime' => 0,
        'path' => $path,
        'domain' => (zen_not_null($cookieDomain) ? $domainPrefix . $cookieDomain : ''),
        'secure' => $secureFlag,
        'httponly' => true,
        'samesite' => $samesite,
    ]);
    
    /**
     * set the session ID if it exists
     */
    if (isset($_POST[zen_session_name()])) {
      zen_session_id($_POST[zen_session_name()]);
    } elseif ( ($request_type == 'SSL') && isset($_GET[zen_session_name()]) ) {
      zen_session_id($_GET[zen_session_name()]);
    }
    That second version is destined for zc157a. From a browser-testing standpoint, I've found Chrome to be the most 'finicky' when it comes to those cookies.

  5. #5
    Join Date
    Aug 2020
    Location
    Finland
    Posts
    12
    Plugin Contributions
    0

    Default Re: Session expired after some payments instead of checkout_success

    Hi! Thank you for response!

    I have first variant:
    PHP Code:
    session_set_cookie_params(0$path, (zen_not_null($cookieDomain) ? $domainPrefix $cookieDomain ''), $secureFlagTRUE); 

  6. #6
    Join Date
    Aug 2020
    Location
    Finland
    Posts
    12
    Plugin Contributions
    0

    Default Re: Session expired after some payments instead of checkout_success

    Now tried the second code, but it got worst. It started to log me out of my account every time after payment.
    Before I could't catch this in Safari, but with second code same problem started on Safari too - logged out after every payment.
    Changed back to first variant - works on Safari again. At least did not log me out after several attempts.

  7. #7
    Join Date
    Oct 2013
    Location
    Canada
    Posts
    30
    Plugin Contributions
    0

    Default Re: Session expired after some payments instead of checkout_success

    Quote Originally Posted by kalm View Post
    Now tried the second code, but it got worst. It started to log me out of my account every time after payment.
    Before I could't catch this in Safari, but with second code same problem started on Safari too - logged out after every payment.
    Changed back to first variant - works on Safari again. At least did not log me out after several attempts.

    Sounds like the same problem I'm having with my epath gateway when it tries to return to the checkout_success page. See https://www.zen-cart.com/showthread....ighlight=epath

    Lat9 referred to a sticky zenid issue which I would like to try and solve if I knew how.

  8. #8
    Join Date
    Oct 2013
    Location
    Canada
    Posts
    30
    Plugin Contributions
    0

    Default Re: Session expired after some payments instead of checkout_success

    Sounds like the same problem I'm having with my epath gateway when it tries to return to the checkout_success page. See https://www.zen-cart.com/showthread....ighlight=epath

    Lat9 referred to a sticky zenid issue which I would like to try and solve if I knew how.

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,872
    Plugin Contributions
    96

    Default Re: Session expired after some payments instead of checkout_success

    Quote Originally Posted by kalm View Post
    Now tried the second code, but it got worst. It started to log me out of my account every time after payment.
    Before I could't catch this in Safari, but with second code same problem started on Safari too - logged out after every payment.
    Changed back to first variant - works on Safari again. At least did not log me out after several attempts.
    Try using the second variant, but also create a file named /includes/extra_datafiles/set_samesite_cookie.php containing:

    PHP Code:
    <?php
    define
    ('COOKIE_SAMESITE''none');
    That will enable you to use the updated version (which will be applied on a zc157a upgrade) and keep the Samesite=None setting.

 

 

Similar Threads

  1. v155 Impossible checkout (Immediate expired session) after server move
    By xavierpages in forum Upgrading to 1.5.x
    Replies: 7
    Last Post: 26 Jul 2016, 01:22 AM
  2. v137 Whoops! Your session has expired. Session Question.
    By weblamer in forum Upgrading to 1.5.x
    Replies: 5
    Last Post: 7 Jun 2015, 07:20 PM
  3. v151 Session Expired problem after installed the stock per atribute plugin
    By alexandregsalves in forum General Questions
    Replies: 0
    Last Post: 30 Jun 2013, 11:23 PM
  4. Whoops! Your session has expired. after paypal continue, since webserver upgraded
    By Justwade in forum PayPal Express Checkout support
    Replies: 15
    Last Post: 12 Jan 2010, 03:03 AM
  5. suddenly 'whoops your session has expired' with Secure Trading payments
    By PhillipHarrison in forum Addon Payment Modules
    Replies: 3
    Last Post: 18 Mar 2009, 01:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg