SessionManager: Use existing backend for the ID if one is loaded
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 22 Mar 2016 21:50:32 +0000 (17:50 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 22 Mar 2016 21:50:32 +0000 (17:50 -0400)
commitdeb46ebfd7542ff820d4028c3644f13ef167f495
treeaaae54cf3f2ceee864bff9e161d20e51e6bade81
parent516f339e739d40155c1507fd99ac54165779c69a
SessionManager: Use existing backend for the ID if one is loaded

This fixes a bug where SessionBackend::resetId() of the PHP session will
fail to properly load $_SESSION because the new session ID hasn't been
saved to the store yet. It's also a reasonable performance improvement,
no need to call loadSessionInfoFromStore() when we already have the
session loaded.

Change-Id: I30f159ef1267442a6325aabbbdfaf69defc10ed6
includes/session/SessionManager.php
tests/phpunit/includes/session/PHPSessionHandlerTest.php
tests/phpunit/includes/session/SessionBackendTest.php
tests/phpunit/includes/session/SessionManagerTest.php