Repository navigation
client: log out the Facebook session on logout - #574
Open
iFixRobots wants to merge 7 commits into
Open
iFixRobots wants to merge 7 commits into
iFixRobots wants to merge 7 commits into
Conversation
Contributor
|
All clear! No issues remaining. 🎉 4 issues already resolved
All required CI checks passed on
Select any unchecked box below to run or rerun that agent. Full resultsIndent Review Agent
|
tulir
reviewed
Nov 12, 2026
tulir
left a comment
Member
There was a problem hiding this comment.
As mentioned in tulir/whatsmeow#1341, just logging out the facebook session might be better, which will automatically log out the whatsapp session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause
On logout the bridge only drops its local state. The Messenger web session behind the cookies stays alive, and with it the bridge's encrypted chat device. Every logout therefore leaves a dead device on the account that every encrypted message to the user is still encrypted for.
Change
For cookie-based Messenger logins (
messengermode),LogoutRemotenow ends the web session with the same request messenger.com sends when you log out, then deletes the local device store as before. Logging out the Facebook session also logs out the encrypted chat session, so no separate device removal is needed.openMessengerLogOut/MessengerLogoutHandler.react) is a form POST toXMessengerDotComLogoutController(/logout/) withfb_dtsgandjazoest(DTSGUtils.getNumericValueof the token). The bridge sendsPOST https://www.messenger.com/logout/,application/x-www-form-urlencoded, bodyfb_dtsg=<token>&jazoest=<page jazoest>, with the session cookies, without following the redirect.Testing
No live before/after was run on this version; no test account was available. The evidence that the encrypted chat device goes away with the session is Tulir's statement on tulir/whatsmeow#1341.
Offline, against a local test server:
POST /logout/, form content type, Referer/Originhttps://www.messenger.com, cookies sent, bodyfb_dtsg=…&jazoest=…; 302 acceptedcontext deadline exceeded, loggedfb_dtsgloadedEarlier versions of this PR removed the device directly through whatsmeow and were tested live. With the request sent directly, the account's device list went from 12 to 11 and the bridge's device was removed. That code is no longer in the PR.
Tag
@indentto continue the conversation here.