Uploaded image for project: 'Moodle QA'
  1. Moodle QA
  2. MDLQA-10403 Moodle 3.3 QA
  3. MDLQA-10918

CLONE - memcache, memcached and redis session handlers can be used to manage users sessions

    XMLWordPrintable

    Details

      Description

      Prerequisites

      1. Memcache server (localhost is fine, otherwise replace 127.0.0.1 below)
      2. memcached, memcache and redis php extensions
      3. autologinguest site setting disabled

      Setup
      We need to test each of them so we need repeat the steps below after setting each of the session handlers in our config.php:

      • memcached session handler
        1. Log out if you are logged in
        2. Remove any config.php $CFG->session_handler_* stuff you previously added
        3. Paste this in your config.php before require_once...lib/setup.php

              $CFG->session_handler_class = '\core\session\memcached';
              $CFG->session_memcached_save_path = '127.0.0.1:11211';
              $CFG->session_memcached_prefix = 'memc.sess.key.';
              $CFG->session_memcached_acquire_lock_timeout = 120;
              $CFG->session_memcached_lock_expire = 7200;
              

      • memcache session handler
        1. Log out if you are logged in
        2. Remove any config.php $CFG->session_handler_* stuff you previously added
        3. Paste this in your config.php before require_once...lib/setup.php

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

      • redis session handler
        1. Log out if you are logged in
        2. Remove any config.php $CFG->session_handler_* stuff you previously added
        3. Paste this in your config.php before require_once...lib/setup.php

              $CFG->session_handler_class = '\core\session\redis';
              $CFG->session_redis_host = '127.0.0.1';
              $CFG->session_redis_port = 6379;  // Optional.
              $CFG->session_redis_database = 0;  // Optional, default is db 0.
              $CFG->session_redis_prefix = 'qa.sess.'; // Optional, default is don't set one.
              $CFG->session_redis_acquire_lock_timeout = 120;
              $CFG->session_redis_lock_expire = 7200;
              

      Test

      1. Use the CLI to run php admin/cli/purge_caches.php
      2. Set it up according to config-dist.php instructions (you can also check Session_handling moodle docs page)
      3. Log in, set browser the url to calendar/view.php press enter and press "Hide group events"
      4. Open a session with the same user in another browser, leave the previous browser session opened
      5. Set the browser url to calendar/view.php press enter, group events should be visible, press "Hide course events"
      6. Return to the previous session and set the browser url to calendar/view.php press enter
      7. Group events should be hidden and course events should be visible
      8. Log out (last opened session)
      9. Open another session with a different user
      10. Go to calendar/view.php and check that all event types are visible by default
      11. Log out (all opened sessions)
      12. Set http://YOURSITE/admin/index.php url in your browser, you should be redirected to the login page
      13. Log in as admin, you should be directed to admin/index.php

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: