-
Notifications
You must be signed in to change notification settings - Fork 240
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
[BUG] ai_user and ai_session cookies not set #1202
Comments
Fix committed, will close once we release the next build (should be within the next week) |
The fix is included in version 2.5.1 which has already been released to NPM and is scheduled to be released to the main CDN channel tomorrow. At which point I'll close this issue. |
Version 2.5.2 is now fully deployed to the CDN, closing as this should address this issue. |
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. |
Description/Screenshot
When viewing the User and Session information in the Application Insights dashboards in the portal, the counts of users/sessions are not accurate - it appears to be counting every request as a new unique user and session.
I believe this is due to the fact that ai_user and ai_session cookies are not being set in the user's browsers. I've checked local security settings and cookies are allowed for the domain.
Steps to Reproduce
Expected behavior
When viewing the User and Session information in the Application Insights dashboards in the portal, the counts of users/sessions should accurately reflect the number of users browsing the site.
However, it appears to be counting every request as a new user and session. From digging around with dev tools, it appears the ai_user and ai_session cookies are not being set. The AI JS is initializing and tracking correctly, but it appears to be unable to support setting the id cookies.
Additional context
I downloaded the latest SDK and referenced it from my website and debugged through the code. The following piece of code from the SDK library is relevant to this issue
When debugging, the variable
Util.document.cookie
always returns a value of "", meaning that thecanUseCookies
function always returns false (at least in my environment).When I remove the last condition
&& Util.document.cookie
, the two cookies - ai_user and ai_session are then set correctly and tracking works as expected.I am also seeing the same behavior in Microsoft Edge version 44.18362.449.0
The text was updated successfully, but these errors were encountered: