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

Commit

Permalink
Merge pull request #842 from LiskHQ/841-configure-cookie
Browse files Browse the repository at this point in the history
 Configure cookie expiry date - Closes #841
  • Loading branch information
MichalTuleja committed Dec 7, 2018
2 parents f8cbe78 + 3c57a3f commit 8b82055
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import 'angular-cookies';
// styles
import 'amstock3/amcharts/style.css';
import 'bootstrap/dist/css/bootstrap.css';
import 'font-awesome/css/font-awesome.css';
import 'leaflet/dist/leaflet.css';
import 'leaflet.markercluster/dist/MarkerCluster.Default.css';
import 'angular-advanced-searchbox/dist/angular-advanced-searchbox.min.css';
Expand Down
7 changes: 6 additions & 1 deletion src/components/cookies-banner/cookies-banner.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ const directiveCtrl = ($scope, $cookies) => {
$scope.visible = true;
const cookieKey = 'cookiesBannerConfirmed';

// setting the expiredate to 2years ahead
const expireDate = new Date();
const expireDays = 365 * 2;
expireDate.setDate(expireDate.getDate() + expireDays);

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

const result = $cookies.get(cookieKey);
Expand Down

0 comments on commit 8b82055

Please sign in to comment.