Open ryancrunchi opened 8 months ago
According to their documentation, you should run the following to properly reset the session:
function userLogout() {
// Execute this sequence when your users are logging out
Crisp.setTokenId(); // 1. Clear the token value
Crisp.session.reset(); // 2. Unbind the current session
}
It's somewhat misleading that the reset method does not clear the token ID associated with the session. I fell into this trap myself.
Hello,
Here are some tests related to issues I faced mostly with session reset, session loading and token id setting. The result seem not logical to me but maybe I use the sdk wrong. The sdk functions called (or onLoaded callback) are given at each steps:
Step 1: anonymous user not connected
Step 2: login as userA
session_1
still visible ❌sessionMerge
false by default)Step 3: logout, now anonymous again
session_2
(maybe a previous session I had locally ??) completely other messages, not related to first anonymous session with Step 1 (session_1
) ❌session_1
or new empty chatboxStep 4: page reload, still anonymous
result: chatbox has messages from
session_2
❌expected: messages from anonymous
session_1
or new empty chatboxStep 5: login as userB
session_2
❌Step 6: page reload as userB
Step 7: logout, now anonymous again
session_3
) ❌session_1
or new empty chatboxStep 8: page reload as anonymous
session_3
) ❌session_1
or new empty chatbox