private initializeUser()

in src/sessions/SessionManager.ts [136:153]


    private initializeUser() {
        let userId: string = '';
        this.userExpiry = new Date();
        this.userExpiry.setDate(
            this.userExpiry.getDate() + this.config.userIdRetentionDays
        );

        if (this.config.userIdRetentionDays <= 0) {
            // Use the 'nil' UUID when the user ID will not be retained
            this.userId = '00000000-0000-0000-0000-000000000000';
        } else if (this.useCookies()) {
            userId = this.getUserIdCookie();
            this.userId = userId ? userId : v4();
            this.createOrRenewUserCookie(userId, this.userExpiry);
        } else {
            this.userId = v4();
        }
    }