Skip to content

SessionState

Defined in: src/client/state-storage.ts:11

What a client knows about its sign-in without holding a credential: which account is signed in here, and when that ends.

Both fields are public. The principal is what an application’s canisters see as the caller, and the expiration is what the identity provider granted, so neither is a secret and both can live somewhere a page reads synchronously.

expiration: bigint

Defined in: src/client/state-storage.ts:15

Nanoseconds since the epoch, matching Delegation.expiration.


held: boolean

Defined in: src/client/state-storage.ts:26

Whether this origin holds a credential for that account, or only knows the sign-in exists.

Derived on read and never published: where the record reaches further than one origin, the record itself cannot carry a per-origin fact. A sibling subdomain that has not acquired its own credential reads the sign-in with held: false, which is what tells it to acquire one.


principal: Principal

Defined in: src/client/state-storage.ts:12