MDL-31501 rework user session architecture
authorPetr Škoda <commits@skodak.org>
Sun, 8 Sep 2013 06:38:52 +0000 (08:38 +0200)
committerPetr Škoda <commits@skodak.org>
Sat, 21 Sep 2013 11:11:56 +0000 (13:11 +0200)
commitd79d5ac2760b7c5508aca8a7b319543ce08e1b17
treef19625faec5f44635611f53b346754b43b6e2d7b
parent81881cb9d67d0b827a38939d09248a2990b01511
MDL-31501 rework user session architecture

List of changes:
 * New OOP API using PHP namespace \core\session\.
 * All handlers now update the sessions table consistently.
 * Experimental DB session support in Oracle.
 * Full support for session file handler (filesystem locking required).
 * New option for alternative session directory.
 * Official memcached session handler support.
 * Workaround for memcached version with non-functional gc.
 * Improved security - forced session id regeneration.
 * Improved compatibility with recent PHP releases.
 * Fixed borked CSS during install in debug mode.
 * Switched to file based sessions in new installs.
 * DB session setting disappears if DB does not support sessions.
 * DB session setting disappears if session handler specified in config.php.
 * Fast purging of sessions used in request only.
 * No legacy distinction -  file, database and memcached support the same functionality.
 * Session handler name included in performance info.
 * Fixed user_loggedin and user_loggedout event triggering.
 * Other minor bugfixing and improvements.
 * Fixed database session segfault if MUC disposed before $DB.

Limitations:
 * Session access time is now updated right after session start.
 * Support for $CFG->sessionlockloggedinonly was removed.
 * First request does not update userid in sessions table.
 * The timeouts may break badly if server hosting forces PHP.ini session settings.
 * The session GC is a lot slower, we do not rely on external session timeouts.
 * There cannot be any hooks triggered at the session write time.
 * File and memcached handlers do not support session lock acquire timeouts.
 * Some low level PHP session functions can not be used directly in Moodle code.
77 files changed:
admin/auth.php
admin/cli/upgrade.php
admin/cron.php
admin/index.php
admin/settings/server.php
admin/tool/assignmentupgrade/batchupgrade.php
admin/tool/dbtransfer/locallib.php
admin/tool/generator/cli/maketestcourse.php
admin/tool/generator/cli/maketestsite.php
admin/tool/uploaduser/index.php
admin/user.php
admin/user/user_bulk_delete.php
auth/ldap/auth.php
auth/mnet/auth.php
auth/shibboleth/index.php
badges/ajax.php
blocks/html/lib.php
blocks/mnet_hosts/block_mnet_hosts.php
calendar/tests/calendartype_test.php
config-dist.php
course/loginas.php
draftfile.php
enrol/index.php
file.php
lang/en/error.php
lib/authlib.php
lib/classes/event/user_loggedin.php
lib/classes/event/user_loggedout.php
lib/classes/session/database.php [new file with mode: 0644]
lib/classes/session/exception.php [new file with mode: 0644]
lib/classes/session/file.php [new file with mode: 0644]
lib/classes/session/handler.php [new file with mode: 0644]
lib/classes/session/manager.php [new file with mode: 0644]
lib/classes/session/memcached.php [new file with mode: 0644]
lib/cronlib.php
lib/datalib.php
lib/deprecatedlib.php
lib/dml/moodle_database.php
lib/dml/mssql_native_moodle_database.php
lib/dml/mysqli_native_moodle_database.php
lib/dml/oci_native_moodle_database.php
lib/dml/pgsql_native_moodle_database.php
lib/dml/sqlite3_pdo_moodle_database.php
lib/dml/sqlsrv_native_moodle_database.php
lib/filelib.php
lib/installlib.php
lib/moodlelib.php
lib/navigationlib.php
lib/outputrenderers.php
lib/phpunit/classes/advanced_testcase.php
lib/phpunit/classes/util.php
lib/phpunit/tests/advanced_test.php
lib/sessionlib.php
lib/setup.php
lib/setuplib.php
lib/tests/authlib_test.php
lib/tests/behat/behat_hooks.php
lib/tests/moodlelib_test.php
lib/tests/session_manager_test.php [new file with mode: 0644]
lib/tests/sessionlib_test.php [deleted file]
lib/upgrade.txt
lib/weblib.php
login/change_password.php
login/token.php
mod/assignment/type/online/assignment.class.php
mod/chat/chat_ajax.php
mod/chat/gui_header_js/insert.php
mod/quiz/report/overview/report.php
report/log/index.php
report/loglive/index.php
repository/lib.php
repository/tests/repositorylib_test.php
rss/file.php
theme/mymobile/renderers.php
user/editadvanced.php
user/index.php
webservice/lib.php