fix: 🐛 Cookie CN was set in past date
This commit is contained in:
parent
51384e9c71
commit
63cd8d2df6
1 changed files with 2 additions and 4 deletions
|
|
@ -186,8 +186,7 @@ export default class CookieNotice {
|
|||
/** Get a new expiration date */
|
||||
private getNewExpirationDate(): Date {
|
||||
const expDate = new Date();
|
||||
expDate.setMonth(this.cookieExpirationDate.getMonth() + this.cookieTimeLife);
|
||||
return expDate;
|
||||
return new Date(expDate.setMonth(expDate.getMonth() + this.cookieTimeLife));
|
||||
}
|
||||
|
||||
// * - CN Browser Cookie Manipulation
|
||||
|
|
@ -274,8 +273,7 @@ export default class CookieNotice {
|
|||
const key = keyValue[0], value = keyValue[1];
|
||||
// * Exp Date
|
||||
if (key === this.cookieExpirationName) {
|
||||
let expDate = new Date();
|
||||
expDate.setMonth(this.cookieExpirationDate.getMonth() + this.cookieTimeLife);
|
||||
let expDate = this.getNewExpirationDate();
|
||||
try {
|
||||
const epochExpiration = Number.parseInt(value);
|
||||
if (!isNaN(epochExpiration)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue