Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Configure cookie expiry date - Closes #841 #842

Merged
merged 3 commits into from
Dec 7, 2018
Merged

Conversation

youxiberlin
Copy link
Contributor

What was the problem?

Cookie expire date for the cookie banner was not working.

How did I fix it?

  • set expireDate to 2 years ahead on cookie-banner.directive.js

How to test it?

  • you can test it on console by removing the cookie and recreate the cookie

Review checklist

$scope.clicked = () => {
$scope.visible = false;
$cookies.put(cookieKey, 'true');
$cookies.put(cookieKey, 'true', { 'expires': expireDate });
Copy link
Contributor

Choose a reason for hiding this comment

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

Jenkins test fails on ESlint step. Once this line aligns to the ESlint rules, the tests should pass.

@@ -20,9 +20,13 @@ const directiveCtrl = ($scope, $cookies) => {
$scope.visible = true;
const cookieKey = 'cookiesBannerConfirmed';

// setting expireDate to 2 years ahead
const expireDate = new Date();
expireDate.setDate(expireDate.getDate() + 730);
Copy link
Contributor

Choose a reason for hiding this comment

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

The 730 value should be written as const with a proper name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants