<?php
 class vB_Request_WebApi extends vB_Request_Web { public function __construct() { parent::__construct(); $this->sessionClass = 'vB_Session_WebApi'; } public function createSessionNew($sessionhash, $restoreSessionInfo) { $deferRememberMe = true; $session = vB_Session_WebApi::createSessionNew($sessionhash, $restoreSessionInfo, $deferRememberMe); $this->setSession($session); $doRememberMe = true; vB::getHooks()->invoke('hookWebApiAfterCreateSessionNew', [ 'userid' => $session->get('userid') ?? 0, 'session' => &$session, 'restoreSessionInfo' => &$restoreSessionInfo, 'doRememberMe' => &$doRememberMe, ]); if (is_a($session, 'vB_Session_WebApi')) { $this->setSession($session); } if ($doRememberMe) { $this->session->doRememberMe($restoreSessionInfo); } $this->session->finalize(); return [ 'sessionhash' => $this->session->get('sessionhash'), 'remembermetoken' => $this->session->getRememberMeToken(), ]; } } 