igpapi — Instagram private API Simulator for Node.js (API reference) 4.18.2
    Preparing search index...

    Function onUserSessionEnd

    • Registers what a process-state owner forgets when its user session ends: the state the app keeps in memory for one user session and drops at logout and at an account switch. endUserSession runs every registration, and adoptLoginAnswer calls it before it adopts the new account.

      The app's own moment is UserSession.completeEndSession(): once the session has stopped, it walks the session-scoped objects and tells each of them onSessionWillEnd() (com/instagram/common/session/UserSession.java:50-62, 453.0.0.57.79), and the objects a session builds through its scoped lazies die with it (UserSession.getScopedLazy, :36-48). The state the Simulator keeps beside the session — process state a later request reads, never in a snapshot — is that session's too where the app builds it from the session, so each owner registers its reset here.

      The registration belongs to session: the platform layer registers it on the very object its login paths read as MobileSession.

      Parameters

      Returns void