Enable cookie support after the SDK has been initialized
See original GitHub issueWe have a home page /
with a cookie banner. We are not allowed to write cookies until the user consents. We initialize the SDK with isCookieUseDisabled=true
. Once the user consents, we would like to immediately write the cookies so when they continue to the next page /sign-in
, same session ID is used there.
We can call appInsights.properties.context.sessionManager.update()
but there seems to be no way to set CoreUtils._canUseCookies
to true
once the SDK has been initialized.
Issue Analytics
- State:
- Created 4 years ago
- Comments:22 (9 by maintainers)
Top Results From Across the Web
Cookies and Storage for Web - Braze
To disable all cookies, use the noCookies option when initializing the Web SDK. Disabling cookies will prevent you from associating anonymous users who...
Read more >Facebook JavaScript SDK does not set access token cookie in ...
After the FB.login method is called, I'm able to retrieve the access token from Facebook, but it's not setting the access token and...
Read more >Updating analyticsEnabled after SDK initialization
I am trying to implement the MarketingCloudSDK for our iOS app and have a question about initialization of the SDK.
Read more >Manage Session Cookies | Firebase Authentication
Session cookie verification requires the Admin SDK to be initialized with a project ID. This happens automatically when you initialize the SDK with...
Read more >Setting an identity (Required) - Zendesk Developer Docs
Note: The Zendesk Support SDK is intended for end-users only. ... you may want to initialize the SDK with an empty identity when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As part of the change that was just checked in, I’ve added some documentation on the readme but I thought here would also be a good location. Moving forward, cookie support will be based on the appInsights instance so enabling disabling after initialization will be simply a case of using. appInsights.getCookieMgr().setEnabled(value: boolean)
I’ve added support for the existing _canUseCookies, but usage is problematic in ES3 environments (won’t always work) and it’s still also global, so if you share an environment with another instance using this will affect other users. And for backward compatibility, disabling via this will still disable globally – even for instance based cookies
Seems like a bug. Will get this in to next release (2.3.1)