$params = $this->extractRequestParams();
- // Init session if necessary
- if ( session_id() == '' ) {
- wfSetupSession();
- }
+ // Make sure session is persisted
+ MediaWiki\Session\SessionManager::getGlobalSession()->persist();
if ( $params['mailpassword'] && !$params['email'] ) {
$this->dieUsageMsg( 'noemail' );
Hooks::run( 'AddNewAccountApiForm', array( $this, $loginForm ) );
$loginForm->load();
- $status = $loginForm->addNewaccountInternal();
+ $status = $loginForm->addNewAccountInternal();
LoggerFactory::getInstance( 'authmanager' )->info( 'Account creation attempt via API', array(
'event' => 'accountcreation',
'status' => $status,