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)':
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.