Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default [Fixed v1.5.1] page_not_found on session timeout?

    Running 1.5.0 locally with no add-ons. If a customer signs in, adds something to their cart, and starts the checkout process but then gets distracted so that the session timeout kicks in, the next time they press a "Continue" button they're taken to the page_not_found page.

    I've traced this issue down to the following code section within /includes/init_includes/init_sanitize.php:

    Code:
      $csrfBlackListLocal = array();
      $csrfBlackList = (isset($csrfBlackListCustom)) ? array_merge($csrfBlackListLocal, $csrfBlackListCustom) : $csrfBlackListLocal;
      if (! isset ( $_SESSION ['securityToken'] ))
      {
        $_SESSION ['securityToken'] = md5 ( uniqid ( rand (), true ) );
      }
      if ((isset ( $_GET ['action'] ) || isset($_POST['action']) ) && $_SERVER['REQUEST_METHOD'] == 'POST')
      {
        $mainPage = isset($_GET['main_page']) ? $_GET['main_page'] : FILENAME_DEFAULT;
        if (!in_array($mainPage, $csrfBlackList))
        {
          if ((! isset ( $_SESSION ['securityToken'] ) || ! isset ( $_POST ['securityToken'] )) || ($_SESSION ['securityToken'] !== $_POST ['securityToken']))
          {
            zen_redirect ( zen_href_link ( FILENAME_PAGE_NOT_FOUND, '', $request_type ) );
          }
        }
      }
    What is happening is that the securityToken is getting reset (due to the session timeout) so that the value in the $_SESSION is not equal to the value in the $_POST array. While the $mainPage value is valid, the $csrfBlackList array value is empty, resulting ultimately in a redirect to the page_not_found page.

    I'm not sure what the $csrfBlackList code is supposed to be doing (it was added for v1.5.0), so I'm wont to simply remove it.

    Any help would be appreciated.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: page_not_found on session timeout?

    FWIW, commenting out the entire code fragment above results in the session timeout redirecting to the time_out page (like it does in previous versions). Any word on what function that code fragment's intended function is/was?

  3. #3
    Join Date
    Jan 2012
    Location
    London / Roma
    Posts
    30
    Plugin Contributions
    0

    Default Re: page_not_found on session timeout?


  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: page_not_found on session timeout?

    caffeitalia, for this issue to be related to yours the customer would need to be signed into your store and then leave your store's page idle for 24+ minutes.

    Any word from the devs on this issue?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: page_not_found on session timeout?

    The change that will be in the next release is as follows:
    Code:
            zen_redirect ( zen_href_link ( FILENAME_PAGE_NOT_FOUND, '', $request_type ) );
    Code:
            zen_redirect ( zen_href_link ( FILENAME_TIME_OUT, '', $request_type ) );
    .

    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.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: page_not_found on session timeout?

    Thanks for the update, DrByte. I'll make that change to my 1.5.0 installations.

 

 

Similar Threads

  1. v139h User session timeout
    By fakeDecoy in forum General Questions
    Replies: 7
    Last Post: 8 Jan 2016, 03:37 AM
  2. Replies: 1
    Last Post: 9 Oct 2012, 09:55 PM
  3. Session Timeout
    By Maximis86 in forum General Questions
    Replies: 1
    Last Post: 24 Feb 2011, 06:33 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR