Uploaded image for project: 'Moodle QA'
  1. Moodle QA
  2. MDLQA-17933 Moodle 4.3 QA
  3. MDLQA-18231

CLONE - redis session handler can be used to manage users sessions

    XMLWordPrintable

Details

    Description

      Prerequisites

      1. Redis server (localhost is fine)
      2. $CFG->autologinguests = 0; (setting disabled)
      3. Two additional language packs installed
      4. Two different browsers

      Redis session handler setup

      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;
        

      Testing

      1. Use the CLI to run php admin/cli/purge_caches.php
      2. Set up the session handling according to config-dist.php instructions (you can also check Session_handling moodle docs page)
      3. Log in and switch the language to a non-default one. Browser through some site-level pages (such as calendar, notes, tags) and make sure the manually selected language is still the current one.
      4. Open a session with the same user in another browser, leave the previous browser session opened
      5. Log in. Check that you end up with the default language and switch the language to yet another one.
      6. Return to the previous session and check the language selected here is still the same, unaffected by the language selected in the other session.
      7. Log out from the last opened session
      8. Open another session with a different user and again check you end up with the default language
      9. Log out from all opened sessions
      10. Set http://YOURSITE/admin/index.php url in your browser, you should be redirected to the login page
      11. Log in as admin and check that you are redirected to where you wanted to be -
        admin/index.php

      Notes

      • To make sure the Redis server is really used, you can do

        $ redis-cli flushall
        

        which should force all users to be logged out.

      • The config-dist.php recommends to use igbinary as the serializer for redis store. At the time of writing this (May 2017) there are reported issues with igbinary and php7 so you may want to use the default serializer.

      Attachments

        1. MDLQA-18231_Boost_1.png
          MDLQA-18231_Boost_1.png
          101 kB
        2. MDLQA-18231_Boost_2.png
          MDLQA-18231_Boost_2.png
          134 kB
        3. MDLQA-18231_Boost_3.png
          MDLQA-18231_Boost_3.png
          61 kB
        4. MDLQA-18231_Boost_4.png
          MDLQA-18231_Boost_4.png
          191 kB
        5. MDLQA-18231_Classic_1.png
          MDLQA-18231_Classic_1.png
          145 kB
        6. MDLQA-18231_Classic_2.png
          MDLQA-18231_Classic_2.png
          163 kB
        7. MDLQA-18231_Classic_3.png
          MDLQA-18231_Classic_3.png
          72 kB
        8. MDLQA-18231_Classic_4.png
          MDLQA-18231_Classic_4.png
          209 kB

        Activity

          People

            andelacruz Angelia Dela Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Clockify

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.