public getSession()

in src/sessions/SessionManager.ts [98:118]


    public getSession(): Session {
        if (this.session.sessionId !== NIL_UUID && !this.useCookies()) {
            // Cookie access has been revoked. Revert to nil session.
            this.session = {
                sessionId: NIL_UUID,
                record: this.sample(),
                eventCount: 0,
                page: this.session.page
            };
        } else if (this.session.sessionId === NIL_UUID && this.useCookies()) {
            // The session does not exist. Create a new one.
            this.createSession();
        } else if (
            this.session.sessionId !== NIL_UUID &&
            new Date() > this.sessionExpiry
        ) {
            // The session has expired. Create a new one.
            this.createSession();
        }
        return this.session;
    }