async function createSessionForUser(req, res, user) {
        const session = await getSession(req, res);
        const origin = getOriginOfRequest(req);
        if (!origin) {
            throw new BadRequestError({
                message: 'Could not determine origin of request. Please ensure an Origin or Referrer header is present.'
            });
        }

        session.user_id = user.id;
        session.origin = origin;
        session.user_agent = req.get('user-agent');
        session.ip = req.ip;

        if (isStaffDeviceVerificationDisabled()) {
            session.verified = true;
        }
    }
createSessionForUser

@param {Req} req
@param {Res} res
@param {User} user
@returns {Promise<void>}