Skip to content

Commit

Permalink
Cookie | Properly remove secure cookie check salt
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumepotier committed May 18, 2018
1 parent 52bb885 commit de2e488
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion build/basil.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@
// if cookie secure activated, ensure it works (not the case if we are in http only)
if (options && options.secure) {
this.set(_salt, _salt, options);
return this.get(_salt) === _salt;
var hasSecurelyPersited = this.get(_salt) === _salt;
this.remove(_salt);
return hasSecurelyPersited;
}
return true;
},
Expand Down
2 changes: 1 addition & 1 deletion build/basil.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/basil.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@
// if cookie secure activated, ensure it works (not the case if we are in http only)
if (options && options.secure) {
this.set(_salt, _salt, options);
return this.get(_salt) === _salt;
var hasSecurelyPersited = this.get(_salt) === _salt;
this.remove(_salt);
return hasSecurelyPersited;
}
return true;
},
Expand Down

0 comments on commit de2e488

Please sign in to comment.