Closed M4R7iNP closed 5 years ago
When logging out, this._session is undefined here: https://github.com/schibsted/account-sdk-browser/blob/f9465d683b061c224d1f909877ce2c461ba5f8ce/src/identity.js#L351
this._session
That is because it is only set upon login/hasSession callback, not on every other pageview: https://github.com/schibsted/account-sdk-browser/blob/f9465d683b061c224d1f909877ce2c461ba5f8ce/src/identity.js#L462
We can either set this._session on every pageview or always use document.cookie.
This issue seems to be fixed by varnishCookieDomain and fallback to document.domain in newest version of SDK. Please re-open if I'm wrong. BTW It is good practise to check isLoggedIn() before calling logout.
varnishCookieDomain
document.domain
isLoggedIn()
When logging out,
this._session
is undefined here: https://github.com/schibsted/account-sdk-browser/blob/f9465d683b061c224d1f909877ce2c461ba5f8ce/src/identity.js#L351That is because it is only set upon login/hasSession callback, not on every other pageview: https://github.com/schibsted/account-sdk-browser/blob/f9465d683b061c224d1f909877ce2c461ba5f8ce/src/identity.js#L462
We can either set
this._session
on every pageview or always use document.cookie.