Uploaded image for project: 'Moodle QA'
  1. Moodle QA
  2. MDLQA-1 Moodle QA testing
  3. MDLQA-9799

redis session handler can be used to manage users sessions

XMLWordPrintable

    • Icon: Functional Test Functional Test
    • Icon: Minor Minor
    • None
    • Original - DO NOT REPORT TEST RESULTS HERE
    • Administration

      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.

            Unassigned Unassigned
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

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