salemdar / angular2-cookie

Implementation of Angular 1.x $cookies service to Angular 2
MIT License
109 stars 29 forks source link

Cookie disappears, even with expires set #57

Closed marchelmon closed 7 years ago

marchelmon commented 7 years ago

This is my code: ` let date = new Date(); date.setDate(date.getDate() + 2);

let options = {expires: date}

this.cookieService.putObject('filter', filter, options);

console.log(this.cookieService.get('filter'));`

The console.log() logs the cookie, the same console.log call after refresh just gives me 'undefined'