Skip to content
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

[ CH 1896 ] Change Cookie TTL to 1 year #3

Merged
merged 3 commits into from
Jun 28, 2018
Merged

Conversation

jjl014
Copy link
Contributor

@jjl014 jjl014 commented Jun 27, 2018

No description provided.

@danmcc
Copy link
Contributor

danmcc commented Jun 27, 2018

Nice! Are you up for adding a test?

@@ -15,6 +15,7 @@
cookie_name: 'ConstructorioID_client_id',
cookie_prefix_for_experiment: 'ConstructorioID_experiment_',
cookie_domain: null,
cookie_time_to_live: 365,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe cookie_days_to_live for clarity?

@@ -46,7 +47,10 @@

ConstructorioID.prototype.set_cookie = function (name, value) {
if (!this.on_node && this.persist) {
var cookie_data = name + '=' + value + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/';
var expires = new Date();
expires.setTime(expires.getTime() + (this.cookie_time_to_live * 24 * 60 * 60 * 1000));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simplified to

var expires = new Date(Date.now() + this.cookie_time_to_live * 24 * 60 * 60 * 1000);

@@ -46,7 +47,8 @@

ConstructorioID.prototype.set_cookie = function (name, value) {
if (!this.on_node && this.persist) {
var cookie_data = name + '=' + value + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/';
var expires = new Date(Date.now() + this.cookie_time_to_live * 24 * 60 * 60 * 1000);
Copy link
Contributor

@rubikzube rubikzube Jun 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't match option name, results in InvalidDate

@rubikzube rubikzube merged commit f8eef6e into master Jun 28, 2018
@rubikzube rubikzube deleted the ch1896/cookie-ttl branch October 25, 2018 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants