Skip to content

Commit

Permalink
Merge pull request #31 from yoriiis/fix/set-cookie
Browse files Browse the repository at this point in the history
Fix set cookie domain
  • Loading branch information
yoriiis committed May 21, 2024
2 parents 1113347 + fa84dab commit 4c7c3da
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 1.3.4

### Fixes

- Fix set cookie domain ([#31](https://github.com/yoriiis/abtasty-debugger/pull/31))

## 1.3.3

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "abtasty-debugger",
"version": "1.3.3",
"version": "1.3.4",
"private": true,
"description": "Browser extension that simplifies the debugging of A/B tests from AB Tasty and adds useful informations",
"homepage": "https://github.com/yoriiis/abtasty-debugger",
Expand Down
4 changes: 2 additions & 2 deletions src/shared/assets/content-scripts/content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getCookie(name) {
* @param {String} options.value Storage value
*/
function setCookie({ name, value }) {
const domain = window.location.host.split('.')
const domain = window.location.host
const isSecure = window.location.protocol === 'https:'

document.cookie = `${name}=${value}; path=/; domain=.${domain};${isSecure ? ' Secure;' : ''}`
Expand Down Expand Up @@ -54,7 +54,7 @@ function changeVariation({ testId, variationId, cookieValue }) {
* @param {String} options.value Cookie value
*/
function removeCookie({ name }) {
const domain = window.location.host.split('.')
const domain = window.location.host
document.cookie = `${name}=; expires=${new Date(0).toUTCString()}; path=/; domain=.${domain};`
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/assets/manifests/manifest-v2.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AB Tasty Debugger",
"version": "1.3.3",
"version": "1.3.4",
"description": "Debug A/B tests from AB Tasty. Open source.",
"background": {
"scripts": ["background.js"]
Expand Down
2 changes: 1 addition & 1 deletion src/shared/assets/manifests/manifest-v3.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AB Tasty Debugger",
"version": "1.3.3",
"version": "1.3.4",
"description": "Debug A/B tests from AB Tasty. Open source.",
"action": {
"default_title": "AB Tasty Debugger",
Expand Down

0 comments on commit 4c7c3da

Please sign in to comment.