Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Get value of t_start as late as possible

t_start is the time the cookie is set, so get it as close to the
time when we set the cookie as possible
  • Loading branch information...
commit a39ad8de9e3a08818bc8e46275db1e113e93c1c9 1 parent 736666a
@bluesmoon authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 plugins/rt.js
View
11 plugins/rt.js
@@ -35,7 +35,7 @@ impl = {
r2: undefined,
setCookie: function(how, url) {
- var t_end, t_start = new Date().getTime(), subcookies;
+ var t_end, t_start, subcookies;
// Disable use of RT cookie by setting its name to a falsy value
if(!this.cookie) {
@@ -43,9 +43,6 @@ impl = {
}
subcookies = BOOMR.utils.getSubCookies(BOOMR.utils.getCookie(this.cookie)) || {};
- if(how) {
- subcookies[how] = t_start;
- }
// We use document.URL instead of location.href because of a bug in safari 4
// where location.href is URL decoded
subcookies.r = d.URL.replace(/#.*/, '');
@@ -62,6 +59,12 @@ impl = {
delete subcookies.nu;
}
+ t_start = new Date().getTime();
+
+ if(how) {
+ subcookies[how] = t_start;
+ }
+
BOOMR.debug("Setting cookie " + BOOMR.utils.objectToString(subcookies), "rt");
if(!BOOMR.utils.setCookie(this.cookie, subcookies, this.cookie_exp)) {
BOOMR.error("cannot set start cookie", "rt");

0 comments on commit a39ad8d

Please sign in to comment.
Something went wrong with that request. Please try again.