Skip to content

Commit 1c78fba

Browse files
tyiuhccursoragent
andcommitted
fix(experiment-tag): use EXP_{slice}_web_exp_id_v2 cookie key
Align root-domain cookie name with the user property name instead of EXP_{slice}_id_v2. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1442966 commit 1c78fba

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/experiment-tag/src/experiment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export class DefaultWebExperimentClient implements WebExperimentClient {
407407
expirationDays: 365,
408408
});
409409

410-
const webExpIdV2CookieKey = `${experimentStorageName}_id_v2`;
410+
const webExpIdV2CookieKey = `${experimentStorageName}_web_exp_id_v2`;
411411
const webExpIdV2LocalFallback = user.web_exp_id_v2 ?? user.web_exp_id;
412412
let generatedSharedId: string | undefined;
413413
const webExpIdV2 = await resolveCrossSubdomainValue(

packages/experiment-tag/test/experiment.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('initializeExperiment', () => {
127127
test('seeds web_exp_id_v2 from existing web_exp_id when cookie is missing', async () => {
128128
const key = stringify(apiKey);
129129
const storageKey = 'EXP_' + key;
130-
const cookieKey = storageKey + '_id_v2';
130+
const cookieKey = storageKey + '_web_exp_id_v2';
131131
mockGlobal.localStorage.getItem.mockImplementation((name: string) => {
132132
if (name === storageKey) {
133133
return JSON.stringify({ web_exp_id: 'existing-id' });

0 commit comments

Comments
 (0)