Skip to content
This repository was archived by the owner on Nov 23, 2019. It is now read-only.

Commit 0fcb8f2

Browse files
committed
remove code to migrate legacy cookies
we've verified that the legacy cookies are not in use anymore, hence we can get rid of this migration logic to simplify the client side code. here's a link to the same change we made on the server (internal link) https://github.com/segmentio/xid/pull/12.
1 parent 12a0cf6 commit 0fcb8f2

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

lib/index.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,6 @@ Segment.prototype.initialize = function() {
169169
self.ready();
170170
});
171171

172-
// Migrate from old cross domain id cookie names
173-
if (this.cookie('segment_cross_domain_id')) {
174-
this.cookie('seg_xid', this.cookie('segment_cross_domain_id'));
175-
this.cookie('seg_xid_fd', this.cookie('segment_cross_domain_id_from_domain'));
176-
this.cookie('seg_xid_ts', this.cookie('segment_cross_domain_id_timestamp'));
177-
this.cookie('segment_cross_domain_id', null);
178-
this.cookie('segment_cross_domain_id_from_domain', null);
179-
this.cookie('segment_cross_domain_id_timestamp', null);
180-
}
181-
182172
// Delete cross domain identifiers.
183173
this.deleteCrossDomainIdIfNeeded();
184174

test/index.test.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -883,14 +883,6 @@ describe('Segment.io', function() {
883883
server.restore();
884884
});
885885

886-
it('should migrate cookies from old to new name', function() {
887-
segment.cookie('segment_cross_domain_id', 'xid-test-1');
888-
segment.initialize();
889-
890-
analytics.assert(segment.cookie('segment_cross_domain_id') == null);
891-
analytics.assert(segment.cookie('seg_xid') === 'xid-test-1');
892-
});
893-
894886
it('should not crash with invalid config', function() {
895887
segment.options.crossDomainIdServers = undefined;
896888

0 commit comments

Comments
 (0)