Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-43975

Sessions: Should support memcache, not just memcached

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      NOTE: You need an instance of the memcached server running in order to carry out this test. The instructions here assume it is running on localhost on the default port.

      0. Test that memcached session driver does not log any errors.

      This test requires access to temporarily modify Moodle code.

      1. In server settings, edit config.php to add the following:

      $CFG->session_handler_class = '\core\session\memcache';
      $CFG->session_memcache_save_path = '127.0.0.1:11211';
      $CFG->session_memcache_acquire_lock_timeout = 120;
      

      2. Visit your Moodle and log in. Click around for a couple of pages (e.g. in the admin screens).

      EXPECTED: You remain logged in (the session is working).

      3. Click 'Log out'. Click to a page that requires login.

      EXPECTED: You are prompted to log in.

      4. Log in again.

      5. Manually edit the script course/view.php to add this line immediately below 'require_login($course)':

      sleep(5);
      

      6. Go to a course page (it will now take 5 seconds longer to load).

      7. In a second browser tab, open the same course page. While it is loading, switch back to the first tab and load the page again.

      EXPECTED: The page loads in the second tab then, after a bit over five seconds more, in the first tab. In other words, the system did not serve both pages simultaneously, but served one (taking 5 seconds) and then only started to serve another one after it had finished the first.

      8. Edit course/view.php to remove the added line.

      9. In a different Web browser, log in using a test account. Go to a course page.

      10. In your main web browser logged in as admin, go to site administration / users / accounts / browse list of users. Find the user.

      11. Click the 'eye' icon to suspend the user account.

      12. In the test Web browser, load the page again.

      EXPECTED: You should be prompted to log in again, as the session has been killed.

      Show
      NOTE: You need an instance of the memcached server running in order to carry out this test. The instructions here assume it is running on localhost on the default port. 0. Test that memcached session driver does not log any errors. This test requires access to temporarily modify Moodle code. 1. In server settings, edit config.php to add the following: $CFG->session_handler_class = '\core\session\memcache'; $CFG->session_memcache_save_path = '127.0.0.1:11211'; $CFG->session_memcache_acquire_lock_timeout = 120; 2. Visit your Moodle and log in. Click around for a couple of pages (e.g. in the admin screens). EXPECTED: You remain logged in (the session is working). 3. Click 'Log out'. Click to a page that requires login. EXPECTED: You are prompted to log in. 4. Log in again. 5. Manually edit the script course/view.php to add this line immediately below 'require_login($course)': sleep(5); 6. Go to a course page (it will now take 5 seconds longer to load). 7. In a second browser tab, open the same course page. While it is loading, switch back to the first tab and load the page again. EXPECTED: The page loads in the second tab then, after a bit over five seconds more, in the first tab. In other words, the system did not serve both pages simultaneously, but served one (taking 5 seconds) and then only started to serve another one after it had finished the first. 8. Edit course/view.php to remove the added line. 9. In a different Web browser, log in using a test account. Go to a course page. 10. In your main web browser logged in as admin, go to site administration / users / accounts / browse list of users. Find the user. 11. Click the 'eye' icon to suspend the user account. 12. In the test Web browser, load the page again. EXPECTED: You should be prompted to log in again, as the session has been killed.
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-43975-master

      Description

      While the MUC system supports both memcache and memcached extensions, there is only a session driver for memcached. There should be one for memcache as well.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14