Skip to content

Commit 2657f9c

Browse files
authored
Merge pull request #114 from amplitude/revert-112-set-session-id
Revert "Set session"
2 parents f3cdc2a + 9366d89 commit 2657f9c

File tree

5 files changed

+2
-50
lines changed

5 files changed

+2
-50
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
## Unreleased
22

3-
* Add setSessionId method.
4-
53
### 3.4.1 (June 29, 2017)
64
* Handle SDK loading errors in the load snippet. Please update the load snippets on your website to [the latest version](https://amplitude.zendesk.com/hc/en-us/articles/115001361248-JavaScript-SDK-Installation#installation).
75
* Migrating setup instructions and SDK documentation in the README file to Zendesk articles.

amplitude.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,19 +1065,6 @@ AmplitudeClient.prototype.setDomain = function setDomain(domain) {
10651065
}
10661066
};
10671067

1068-
AmplitudeClient.prototype.setSessionId = function setSessionId(sessionId) {
1069-
if (!utils.validateInput(sessionId, 'sessionId', 'number')) {
1070-
return;
1071-
}
1072-
1073-
try {
1074-
this._sessionId = sessionId;
1075-
_saveCookieData(this);
1076-
} catch (e) {
1077-
utils.log(e);
1078-
}
1079-
};
1080-
10811068
/**
10821069
* Sets an identifier for the current user.
10831070
* @public

amplitude.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/amplitude-client.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -584,19 +584,6 @@ AmplitudeClient.prototype.setDomain = function setDomain(domain) {
584584
}
585585
};
586586

587-
AmplitudeClient.prototype.setSessionId = function setSessionId(sessionId) {
588-
if (!utils.validateInput(sessionId, 'sessionId', 'number')) {
589-
return;
590-
}
591-
592-
try {
593-
this._sessionId = sessionId;
594-
_saveCookieData(this);
595-
} catch (e) {
596-
utils.log(e);
597-
}
598-
};
599-
600587
/**
601588
* Sets an identifier for the current user.
602589
* @public

test/amplitude-client.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,6 @@ describe('setVersionName', function() {
26922692
describe('sessionId', function() {
26932693
var clock;
26942694
beforeEach(function() {
2695-
reset();
26962695
clock = sinon.useFakeTimers();
26972696
amplitude.init(apiKey);
26982697
});
@@ -2723,24 +2722,5 @@ describe('setVersionName', function() {
27232722
assert.equal(amplitude2.getSessionId(), timestamp);
27242723
assert.equal(amplitude2.getSessionId(), amplitude2._sessionId);
27252724
});
2726-
2727-
it('should let user override sessionId with setSessionId', function() {
2728-
var amplitude2 = new AmplitudeClient();
2729-
var cookieStorage = new CookieStorage().getStorage();
2730-
2731-
// set up initial session
2732-
var sessionId = 1000;
2733-
clock.tick(sessionId);
2734-
amplitude2.init(apiKey);
2735-
assert.equal(amplitude2._sessionId, sessionId);
2736-
assert.equal(cookieStorage.get(amplitude2.options.cookieName).sessionId, sessionId);
2737-
2738-
// override sessionId with setSessionId
2739-
var newSessionId = 10000;
2740-
amplitude2.setSessionId(newSessionId);
2741-
assert.equal(amplitude2._sessionId, newSessionId);
2742-
// verify saved to cookie
2743-
assert.equal(cookieStorage.get(amplitude2.options.cookieName).sessionId, newSessionId);
2744-
});
27452725
});
27462726
});

0 commit comments

Comments
 (0)