/** * Generate a new token and auth_hash, save the token in the database * @param $id * @param $password_hash */ private function setNewSessionToken($id, $password_hash) { // create unique token $tokens = ['token' => WposAdminUtilities::getToken()]; // create auth_hash $tokens['auth_hash'] = hash('sha256', $password_hash . $tokens['token']); // save tokens $this->authMdl->setAuthToken($id, $tokens['token']); $this->authTokens = $tokens; }