Skip to content

Commit c615e3f

Browse files
author
Gleap Coder Agent
committed
Coder Agent: # Task: Fix the reported bug
Please read the customer report below carefully, find the **root cause** in the code (not just the symptom), and ship a clean fix. Treat the customer's description as a r
1 parent c6d30cf commit c615e3f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/GleapSession.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ export default class GleapSession {
171171
GleapEventManager.notifyEvent('unregister-pushmessage-group', `gleapuser-${this.session.gleapHash}`);
172172
}
173173

174-
saveToGleapCache(`session-${this.sdkKey}`, session);
175174
if (this.useCookies) {
176175
setGleapCookie(`session-${this.sdkKey}`, encodeURIComponent(JSON.stringify(session)), 365);
176+
} else {
177+
saveToGleapCache(`session-${this.sdkKey}`, session);
177178
}
178179

179180
this.session = session;
@@ -224,7 +225,7 @@ export default class GleapSession {
224225
} catch (exp) {}
225226

226227
// Try to load session from local storage, if not already loaded.
227-
if (!(this.session && this.session.gleapId && this.session.gleapId.length > 0)) {
228+
if (!this.useCookies && !(this.session && this.session.gleapId && this.session.gleapId.length > 0)) {
228229
const cachedSession = loadFromGleapCache(`session-${this.sdkKey}`);
229230
if (cachedSession) {
230231
this.validateSession(cachedSession);

0 commit comments

Comments
 (0)