ngx-cookie-service
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -22,10 +22,11 @@ import { InjectionToken } from '@angular/core'; | ||
/** | ||
* @param name Cookie name | ||
* @param value Cookie value | ||
* @param expires Number of days until the cookies expires or an actual `Date` | ||
* @param path Cookie path | ||
* @param domain Cookie domain | ||
* @param secure Secure flag | ||
* @param name Cookie name | ||
* @param value Cookie value | ||
* @param expires Number of days until the cookies expires or an actual `Date` | ||
* @param path Cookie path | ||
* @param domain Cookie domain | ||
* @param secure Secure flag | ||
* @param sameSite OWASP samesite token `Lax` or `Strict` | ||
*/ | ||
set(name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean): void; | ||
set(name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'Strict'): void; | ||
/** | ||
@@ -32,0 +33,0 @@ * @param name Cookie name |
@@ -67,10 +67,11 @@ // This service is based on the `ng2-cookies` package which sadly is not a service and does | ||
/** | ||
* @param name Cookie name | ||
* @param value Cookie value | ||
* @param expires Number of days until the cookies expires or an actual `Date` | ||
* @param path Cookie path | ||
* @param domain Cookie domain | ||
* @param secure Secure flag | ||
* @param name Cookie name | ||
* @param value Cookie value | ||
* @param expires Number of days until the cookies expires or an actual `Date` | ||
* @param path Cookie path | ||
* @param domain Cookie domain | ||
* @param secure Secure flag | ||
* @param sameSite OWASP samesite token `Lax` or `Strict` | ||
*/ | ||
CookieService.prototype.set = function (name, value, expires, path, domain, secure) { | ||
CookieService.prototype.set = function (name, value, expires, path, domain, secure, sameSite) { | ||
if (!this.documentIsAccessible) { | ||
@@ -98,2 +99,5 @@ return; | ||
} | ||
if (sameSite) { | ||
cookieString += 'sameSite=' + sameSite + ';'; | ||
} | ||
this.document.cookie = cookieString; | ||
@@ -100,0 +104,0 @@ }; |
{ | ||
"name": "ngx-cookie-service", | ||
"description": "an (aot ready) angular (4.2+) cookie service", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"license": "MIT", | ||
@@ -48,2 +48,5 @@ "author": "7leads GmbH <info@7leads.org>", | ||
"name": "mattbanks" | ||
}, | ||
{ | ||
"name": "DBaker85" | ||
} | ||
@@ -50,0 +53,0 @@ ], |
@@ -86,3 +86,3 @@ # NGX Cookie Service | ||
## set( name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean ): void; | ||
## set( name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'Strict' ): void; | ||
@@ -89,0 +89,0 @@ ```typescript |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22833
196
0