Skip to content

Commit

Permalink
PLATIR-42315 Ensure audience cookies are set on the default path. (#1160
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dompuiu authored Aug 14, 2024
1 parent a4b2d01 commit 018d0b3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/utils/cookieJar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ governing permissions and limitations under the License.

import cookie from "js-cookie";


export default {
get: cookie.get,
set: cookie.set,
remove: cookie.remove,
withConverter: cookie.withConverter
get: cookie.get.bind(cookie),
set: cookie.set.bind(cookie),
remove: cookie.remove.bind(cookie),
withConverter: cookie.withConverter.bind(cookie)
};
15 changes: 15 additions & 0 deletions test/functional/specs/Audiences/C12412.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,18 @@ test(`Verify cookie destinations are returned in the response when turned on in
await t.expect(setCookieAttributes[0].sameSite).eql("none");
await t.expect(setCookieAttributes[0].secure).eql(true);
});

test(`Verify cookie is set on the / path `, async () => {
const alloy = createAlloyProxy();

await alloy.configure(compose(orgMainConfigMain, debugEnabled));
await alloy.sendEvent();

const cookies = await t.getCookies("C12412");

// In Firefox, the t.getCookies method returns an empty array even if the cookie is present.
// The if condition below is to handle this issue.
if (cookies.length > 0) {
await t.expect(cookies[0].path).eql("/");
}
});

0 comments on commit 018d0b3

Please sign in to comment.