Angular 如何使用“ngx cookie服务”设置cookie过期日期`
我正在为我的angular5应用程序使用Angular 如何使用“ngx cookie服务”设置cookie过期日期`,angular,angular5,Angular,Angular5,我正在为我的angular5应用程序使用ngx cookie服务。有人能帮我指明设定过期日期的方法吗 我试着这样: setCookies($event){ this.cookieService.set( 'retailAppCookies', "true", 30 ); this.cookieService.set( 'expires', '2030-07-19' ); } 但这不管用。有人帮我吗?您不能在ngx cookie服务中添加日期您必须添加以下
ngx cookie服务
。有人能帮我指明设定过期日期的方法吗
我试着这样:
setCookies($event){
this.cookieService.set( 'retailAppCookies', "true", 30 );
this.cookieService.set( 'expires', '2030-07-19' );
}
但这不管用。有人帮我吗?您不能在ngx cookie服务中添加日期您必须添加以下天数
this.cookieService.set('CookieName', 'Cookie Value', 5);
这将在5天后过期这篇文章是否解决了同样的问题?我想答案可以帮助你。