<?php
 class vB_Session_Web extends vB_Session { public static function getSession($userId, $sessionHash = '', $dBAssertor = null, $datastore = null, $config = null) { $dBAssertor = $dBAssertor ?: vB::getDbAssertor(); $datastore = $datastore ?: vB::getDatastore(); $config = $config ?: vB::getConfig(); $restoreSessionInfo = ['userid' => $userId]; $session = new vB_Session_Web($dBAssertor, $datastore, $config, $sessionHash, $restoreSessionInfo); $session->set('userid', $userId); $session->fetch_userinfo(); return $session; } protected function __construct(&$dBAssertor, &$datastore, &$config, $sessionhash = '', $restoreSessionInfo = [], $styleid = 0, $languageid = 0, $deferRememberMe = false) { parent::__construct($dBAssertor, $datastore, $config, $sessionhash, $restoreSessionInfo, $styleid, $languageid, $deferRememberMe); } protected function createSessionIdHash() { $request = vB::getRequest(); $this->sessionIdHash = md5($request->getUserAgent() . $this->fetch_substr_ip($request->getAltIp())); } } 