Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Cookies #1125

Closed
PartisanEntity opened this issue Dec 3, 2019 · 6 comments
Closed

Disable Cookies #1125

PartisanEntity opened this issue Dec 3, 2019 · 6 comments

Comments

@PartisanEntity
Copy link

We want to disable the Application Insights cookies for our EPiServer project.

I was told that we need to set isCookieUseDisabled to true in ApplicationInsights.config. But I think this is incorrect?

From what I have managed to gather so far this settings needs to go in https://az416426.vo.msecnd.net/scripts/a/ai.0.js - is my assumption correct?

If yes, then I would need to download this JS file, modify it and then point to my modified version?

Thankful for any help.

@MSNev
Copy link
Collaborator

MSNev commented Dec 3, 2019

Setting the config entry "isCookieUseDisabled" to a value of true is the correct way to tell the SDK not to use cookies (set, get, delete).

There is also a global switch we are are considering moving Util.disableCookies() or CoreUtils.disableCookies() which disable the cookies functions for ALL AppInsights usages (this means that if you are using another component on your page and it also uses AppInsights then it will also be disabled.

Discussion on this is on the following issue
#1091

Cheers
Nev

@PartisanEntity
Copy link
Author

Thanks very much, where do I need to set this? In which file?

@MSNev
Copy link
Collaborator

MSNev commented Dec 3, 2019

You canb just set this as part of the configuration (same location as the instrumentationKey).
const appInsights = new ApplicationInsights({ config: {
instrumentationKey: 'YOUR_INSTRUMENTATION_KEY_GOES_HERE'
/* ...Other Configuration Options... */
isCookieUseDisabled: true
} });

However, as per the other thread, there is currently no non-hacky way to re-enable for the session.

@markwolff
Copy link
Contributor

markwolff commented Dec 3, 2019

I am not sure if ApplicationInsights.config propagates the setting over to the JS snippet (it might, please verify!), but if you can tweak the snippet, what Nev mentioned is all you would need to do. You do not need to modify ai.0.js.

See here https://github.com/microsoft/applicationinsights-js#basic-usage

@MSNev
Copy link
Collaborator

MSNev commented Jan 29, 2020

Closing as seems to be resolved @PartisanEntity please feel free to reopen if not.

@MSNev MSNev closed this as completed Jan 29, 2020
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 6, 2021
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 6, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 8, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 8, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 9, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 10, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 10, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 11, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 12, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 12, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit to MSNev/ApplicationInsights-JS that referenced this issue Mar 12, 2021
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code microsoft#1076
Also addresses
- Disable Cookies microsoft#1125
- Ability to specify cookie Path so that AI works behind App Gateway microsoft#1434
MSNev added a commit that referenced this issue Mar 17, 2021
* Enable cookie support after the SDK has been initialized #1091
Utils - Tree-Shaking enhancements
Refactor code to provide better tree shaking and minification of generated code #1076
Also addresses
- Disable Cookies #1125
- Ability to specify cookie Path so that AI works behind App Gateway #1434

* Update Documentation and Core Perf Tests
- address circular dependencies

* Add missing api exports
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants