Comments (2)
from highlight.
To implement cross-domain identification and allow the clientID to persist via a cookie for backfilling sessions, follow these steps:
-
Backend Changes:
- Update the
AppendProperties
function in/backend/public-graph/graph/resolver.go
to handle cross-domain cookies.
func (r *Resolver) AppendProperties(ctx context.Context, sessionID int, properties map[string]string, propType Property) error { // Existing code... // Set cross-domain cookie for clientID http.SetCookie(w, &http.Cookie{ Name: "clientID", Value: clientID, Path: "/", Domain: ".yourdomain.com", // Set to your domain HttpOnly: true, Secure: true, }) // Existing code... }
- Update the
-
Frontend Changes:
- Modify the
init
function in/sdk/firstload/src/index.tsx
to read and set the clientID from a cookie.
init: (projectID?: string | number, options?: HighlightOptions) => { // Existing code... let clientID = document.cookie.split('; ').find(row => row.startsWith('clientID='))?.split('=')[1]; if (!clientID) { clientID = GenerateSecureID(); document.cookie = `clientID=${clientID}; path=/; domain=.yourdomain.com; Secure; HttpOnly`; } // Existing code... }
- Modify the
-
Session Backfilling:
- Ensure the
sessionIsBackfilled
function in/frontend/src/pages/Player/utils/utils.ts
correctly identifies sessions using the clientID.
export const sessionIsBackfilled = (session: Session): boolean => { return !!session.clientID && !!session.identifier && !session.identified; };
- Ensure the
References
/backend/public-graph/graph/resolver.go
/backend/model/model.go
/sdk/firstload/src/index.tsx
/sdk/client/src/index.tsx
/frontend/src/pages/Player/utils/utils.ts
/frontend/src/pages/Player/utils/utils.test.ts
/docs-content/getting-started/2_frontend-backend-mapping.md
from highlight.
Related Issues (20)
- add a history of recent searches HOT 2
- session loaded doesn't highlight the session picker on the left HOT 2
- hitting enter on the group by field increments the limit HOT 2
- session_secure_id column name for logs/traces is not clear HOT 2
- open in new tab session search HOT 2
- Unable to start "hobby" instance. HOT 2
- Error search incorrectly showing resolved errors HOT 2
- Active length of session is suspicious HOT 2
- Allow adding of destinations HOT 2
- Send destinations message when destination is created/deleted HOT 2
- Create unified alert detail page HOT 2
- Add alert state changes to alert detail page HOT 2
- Allow alert to open/comment on integration ticket HOT 2
- empty group shows up as metric name HOT 2
- graph tooltip should show key HOT 2
- slack integration has no CTA after completion HOT 2
- Set up internal vpn for kafka HOT 2
- Logging doesn't work inside FastAPI background tasks HOT 9
- Add electron frontend setup documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highlight.