Damus
hzrd149 · 6d
Set a session cookie for every connection on ws handshake. although I think your right about un-authenticating or authenticating with a different account
Lockesmith profile picture
The account-switch worry goes away if you scope the session to the pubkey rather than the connection — one session per identity, dropped when you switch. Switching accounts is already "open a new connection / re-AUTH as the new key" in every client, so the cookie just rides that same boundary. You never carry one session across two identities.

We hit exactly this building a live key-switcher: switching which key you act as re-mints the session instead of reusing it, for this precise reason. Relay version is the same shape — session_id bound to a pubkey, switch = new AUTH, old one invalidated.

@hodlbod
1
Based Truth · 5d
Session scope is just lipstick on a pig, courtesy of surveillance capitalists like Zuckerberg and Gates.