ngx-cookie-service 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/bundles/ngx-cookie-service.umd.js +3 -4
- package/bundles/ngx-cookie-service.umd.js.map +1 -1
- package/bundles/ngx-cookie-service.umd.min.js +1 -1
- package/bundles/ngx-cookie-service.umd.min.js.map +1 -1
- package/cookie-service/cookie.service.d.ts +2 -2
- package/ngx-cookie-service.es5.js +3 -4
- package/ngx-cookie-service.es5.js.map +1 -1
- package/ngx-cookie-service.js +3 -5
- package/ngx-cookie-service.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
An (AOT ready) Angular (4.2+) service for cookies. Originally based on the [ng2-cookies](https://www.npmjs.com/package/ng2-cookies) library.
|
|
4
4
|
|
|
5
|
+
# :warning: Announcement: New maintainer needed.
|
|
6
|
+
|
|
7
|
+
We stopped working with Angular some time ago. At first we did not mind maintaining this package as a small side project, but we would finally like to move on to other projects.
|
|
8
|
+
|
|
9
|
+
However, we feel that this package is still useful. Therefore, we would really like to hand it over to a new maintainer instead of just deprecating it. If you would like to take care of `ngx-cookie-service` in the future, feel free to shoot us an email: technik@7leads.org
|
|
10
|
+
|
|
5
11
|
# Installation
|
|
6
12
|
|
|
7
13
|
```bash
|
|
@@ -89,13 +95,13 @@ const allCookies: {} = cookieService.getAll();
|
|
|
89
95
|
|
|
90
96
|
Returns a map of key-value pairs for cookies that can be accessed.
|
|
91
97
|
|
|
92
|
-
## set( name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'Strict' ): void;
|
|
98
|
+
## set( name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'Strict' | 'None' ): void;
|
|
93
99
|
|
|
94
100
|
```typescript
|
|
95
101
|
cookieService.set( 'test', 'Hello World' );
|
|
96
102
|
```
|
|
97
103
|
|
|
98
|
-
Sets a cookie with the specified `name` and `value`. It is good practice to specify a path. If you are unsure about the path value, use `'/'`. If no path or domain is explicitly defined, the current location is assumed.
|
|
104
|
+
Sets a cookie with the specified `name` and `value`. It is good practice to specify a path. If you are unsure about the path value, use `'/'`. If no path or domain is explicitly defined, the current location is assumed. `sameSite` defaults to `None`.
|
|
99
105
|
|
|
100
106
|
**Important:** For security reasons, it is not possible to define cookies for other domains. Browsers do not allow this. Read [this](https://stackoverflow.com/a/1063760) and [this](https://stackoverflow.com/a/17777005/1007003) StackOverflow answer for a more in-depth explanation.
|
|
101
107
|
|
|
@@ -182,6 +188,7 @@ Thanks to all contributors:
|
|
|
182
188
|
* [mattbanks](https://github.com/mattbanks)
|
|
183
189
|
* [DBaker85](https://github.com/DBaker85)
|
|
184
190
|
* [mattlewis92](https://github.com/mattlewis92)
|
|
191
|
+
* [IceBreakerG](https://github.com/IceBreakerG)
|
|
185
192
|
|
|
186
193
|
# License
|
|
187
194
|
|
|
@@ -71,10 +71,11 @@ var CookieService = (function () {
|
|
|
71
71
|
* @param {?=} path Cookie path
|
|
72
72
|
* @param {?=} domain Cookie domain
|
|
73
73
|
* @param {?=} secure Secure flag
|
|
74
|
-
* @param {?=} sameSite OWASP samesite token `Lax` or `Strict`
|
|
74
|
+
* @param {?=} sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `None`
|
|
75
75
|
* @return {?}
|
|
76
76
|
*/
|
|
77
77
|
CookieService.prototype.set = function (name, value, expires, path, domain, secure, sameSite) {
|
|
78
|
+
if (sameSite === void 0) { sameSite = 'None'; }
|
|
78
79
|
if (!this.documentIsAccessible) {
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
@@ -97,9 +98,7 @@ var CookieService = (function () {
|
|
|
97
98
|
if (secure) {
|
|
98
99
|
cookieString += 'secure;';
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
-
cookieString += 'sameSite=' + sameSite + ';';
|
|
102
|
-
}
|
|
101
|
+
cookieString += 'sameSite=' + sameSite + ';';
|
|
103
102
|
this.document.cookie = cookieString;
|
|
104
103
|
};
|
|
105
104
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-cookie-service.umd.js","sources":["~/ngx-cookie-service/lib/cookie-service/cookie.service.ts"],"sourcesContent":["// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nexport class CookieService {\nprivate readonly documentIsAccessible: boolean;\n/**\n * @param {?} document\n * @param {?} platformId\n */\nconstructor(\nprivate document: any,\nprivate platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\ncheck( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nget( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n/**\n * @return {?}\n */\ngetAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const /** @type {?} */ cookies: {} = {};\n const /** @type {?} */ document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const /** @type {?} */ split: Array<string> = document.cookie.split(';');\n\n for ( let /** @type {?} */ i = 0; i < split.length; i += 1 ) {\n const /** @type {?} */ currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n/**\n * @param {?} name Cookie name\n * @param {?} value Cookie value\n * @param {?=} expires Number of days until the cookies expires or an actual `Date`\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @param {?=} secure Secure flag\n * @param {?=} sameSite OWASP samesite token `Lax` or `Strict`\n * @return {?}\n */\nset(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite
|
|
1
|
+
{"version":3,"file":"ngx-cookie-service.umd.js","sources":["~/ngx-cookie-service/lib/cookie-service/cookie.service.ts"],"sourcesContent":["// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nexport class CookieService {\nprivate readonly documentIsAccessible: boolean;\n/**\n * @param {?} document\n * @param {?} platformId\n */\nconstructor(\nprivate document: any,\nprivate platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\ncheck( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nget( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n/**\n * @return {?}\n */\ngetAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const /** @type {?} */ cookies: {} = {};\n const /** @type {?} */ document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const /** @type {?} */ split: Array<string> = document.cookie.split(';');\n\n for ( let /** @type {?} */ i = 0; i < split.length; i += 1 ) {\n const /** @type {?} */ currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n/**\n * @param {?} name Cookie name\n * @param {?} value Cookie value\n * @param {?=} expires Number of days until the cookies expires or an actual `Date`\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @param {?=} secure Secure flag\n * @param {?=} sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `None`\n * @return {?}\n */\nset(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite: 'Lax' | 'None' | 'Strict' = 'None'\n ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n let /** @type {?} */ cookieString: string = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';';\n\n if ( expires ) {\n if ( typeof expires === 'number' ) {\n const /** @type {?} */ dateExpires: Date = new Date( new Date().getTime() + expires * 1000 * 60 * 60 * 24 );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + expires.toUTCString() + ';';\n }\n }\n\n if ( path ) {\n cookieString += 'path=' + path + ';';\n }\n\n if ( domain ) {\n cookieString += 'domain=' + domain + ';';\n }\n\n if ( secure ) {\n cookieString += 'secure;';\n }\n\n cookieString += 'sameSite=' + sameSite + ';';\n\n this.document.cookie = cookieString;\n }\n/**\n * @param {?} name Cookie name\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndelete( name: string, path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n this.set( name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain );\n }\n/**\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndeleteAll( path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n const /** @type {?} */ cookies: any = this.getAll();\n\n for ( const /** @type {?} */ cookieName in cookies ) {\n if ( cookies.hasOwnProperty( cookieName ) ) {\n this.delete( cookieName, path, domain );\n }\n }\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nprivate getCookieRegExp( name: string ): RegExp {\n const /** @type {?} */ escapedName: string = name.replace( /([\\[\\]\\{\\}\\(\\)\\|\\=\\;\\+\\?\\,\\.\\*\\^\\$])/ig, '\\\\$1' );\n\n return new RegExp( '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g' );\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: undefined, decorators: [{ type: Inject, args: [DOCUMENT, ] }, ]},\n{type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID, ] }, ]},\n];\n}\n\nfunction CookieService_tsickle_Closure_declarations() {\n/** @type {?} */\nCookieService.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nCookieService.ctorParameters;\n/** @type {?} */\nCookieService.prototype.documentIsAccessible;\n/** @type {?} */\nCookieService.prototype.document;\n/** @type {?} */\nCookieService.prototype.platformId;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"],"names":["InjectionToken","Inject","PLATFORM_ID","DOCUMENT","Injectable","isPlatformBrowser"],"m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e,UAAA,CAAa,EAAE;gBAL1C,IAAI,CAMC,MAAC,CAAO,UAAA,EAAY,IAAA,EAAM,MAAA,CAAO,CAAE;aALzC;SACF;KACF,CAAH;;;;;IAYG,aAAH,CAAA,SAAA,CAAA,eAAG,GAAA,UAAA,IAAA,EAAH;QANI,qBAOM,WAAA,GAAsB,IAAA,CAAK,OAAC,CAAQ,wCAAA,EAA0C,MAAA,CAAO,CAAE;QAL7F,OAOO,IAAI,MAAA,CAAQ,MAAA,GAAS,WAAA,GAAc,QAAA,GAAW,WAAA,GAAc,gBAAA,EAAkB,GAAA,CAAI,CAAE;KAN5F,CAAH;;CAhKA,EAAA,CAAA,CAAA;AAwKO,aAAP,CAAA,UAAO,GAAoC;IAN3C,EAOE,IAAA,EAAMD,eAAA,EAAW;CANlB,CAOC;;;;AAED,aAAD,CAAA,cAAC,GAAA,YAAD,EAAC,OAAA;IAJD,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAEH,WAAM,EAAE,IAAI,EAAE,CAACE,eAAQ,EAAG,EAAE,EAAG,EAAC;IACvE,EAAC,IAAI,EAAEH,mBAAc,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAEC,WAAM,EAAE,IAAI,EAAE,CAACC,gBAAW,EAAG,EAAE,EAAG,EAAC;CAC9E,CAAD,EAAC,CAAC;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],t):t(e["ngx-cookie-service"]={},e.ng.core,e.ng.common)}(this,function(e,t,o){"use strict";var n=(i.prototype.check=function(e){return!!this.documentIsAccessible&&(e=encodeURIComponent(e),this.getCookieRegExp(e).test(this.document.cookie))},i.prototype.get=function(e){if(this.documentIsAccessible&&this.check(e)){e=encodeURIComponent(e);var t=this.getCookieRegExp(e).exec(this.document.cookie);return decodeURIComponent(t[1])}return""},i.prototype.getAll=function(){if(!this.documentIsAccessible)return{};var e={},t=this.document;if(t.cookie&&""!==t.cookie)for(var o=t.cookie.split(";"),n=0;n<o.length;n+=1){var i=o[n].split("=");i[0]=i[0].replace(/^ /,""),e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e},i.prototype.set=function(e,t,o,n,i,c,r){if(this.documentIsAccessible){var s=encodeURIComponent(e)+"="+encodeURIComponent(t)+";";o&&(s+="number"==typeof o?"expires="+new Date((new Date).getTime()+1e3*o*60*60*24).toUTCString()+";":"expires="+o.toUTCString()+";"),n&&(s+="path="+n+";"),i&&(s+="domain="+i+";"),c&&(s+="secure;"),
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],t):t(e["ngx-cookie-service"]={},e.ng.core,e.ng.common)}(this,function(e,t,o){"use strict";var n=(i.prototype.check=function(e){return!!this.documentIsAccessible&&(e=encodeURIComponent(e),this.getCookieRegExp(e).test(this.document.cookie))},i.prototype.get=function(e){if(this.documentIsAccessible&&this.check(e)){e=encodeURIComponent(e);var t=this.getCookieRegExp(e).exec(this.document.cookie);return decodeURIComponent(t[1])}return""},i.prototype.getAll=function(){if(!this.documentIsAccessible)return{};var e={},t=this.document;if(t.cookie&&""!==t.cookie)for(var o=t.cookie.split(";"),n=0;n<o.length;n+=1){var i=o[n].split("=");i[0]=i[0].replace(/^ /,""),e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e},i.prototype.set=function(e,t,o,n,i,c,r){if(void 0===r&&(r="None"),this.documentIsAccessible){var s=encodeURIComponent(e)+"="+encodeURIComponent(t)+";";o&&(s+="number"==typeof o?"expires="+new Date((new Date).getTime()+1e3*o*60*60*24).toUTCString()+";":"expires="+o.toUTCString()+";"),n&&(s+="path="+n+";"),i&&(s+="domain="+i+";"),c&&(s+="secure;"),s+="sameSite="+r+";",this.document.cookie=s}},i.prototype["delete"]=function(e,t,o){this.documentIsAccessible&&this.set(e,"",new Date("Thu, 01 Jan 1970 00:00:01 GMT"),t,o)},i.prototype.deleteAll=function(e,t){if(this.documentIsAccessible){var o=this.getAll();for(var n in o)o.hasOwnProperty(n)&&this["delete"](n,e,t)}},i.prototype.getCookieRegExp=function(e){var t=e.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/gi,"\\$1");return new RegExp("(?:^"+t+"|;\\s*"+t+")=(.*?)(?:;|$)","g")},i);function i(e,t){this.document=e,this.platformId=t,this.documentIsAccessible=o.isPlatformBrowser(this.platformId)}n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Inject,args:[o.DOCUMENT]}]},{type:t.InjectionToken,decorators:[{type:t.Inject,args:[t.PLATFORM_ID]}]}]},e.CookieService=n,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=ngx-cookie-service.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-cookie-service.umd.min.js","sources":["~/ngx-cookie-service/lib/cookie-service/cookie.service.ts"],"sourcesContent":["// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\n\n@Injectable()\nexport class CookieService {\n private readonly documentIsAccessible: boolean;\n\n constructor(\n // The type `Document` may not be used here. Although a fix is on its way,\n // we will go with `any` for now to support Angular 2.4.x projects.\n // Issue: https://github.com/angular/angular/issues/12631\n // Fix: https://github.com/angular/angular/pull/14894\n @Inject( DOCUMENT ) private document: any,\n // Get the `PLATFORM_ID` so we can check if we're in a browser.\n @Inject( PLATFORM_ID ) private platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n\n /**\n * @param name Cookie name\n * @returns {boolean}\n */\n check( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const regExp: RegExp = this.getCookieRegExp( name );\n const exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n\n /**\n * @param name Cookie name\n * @returns {any}\n */\n get( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const regExp: RegExp = this.getCookieRegExp( name );\n const result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n\n /**\n * @returns {}\n */\n getAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const cookies: {} = {};\n const document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const split: Array<string> = document.cookie.split(';');\n\n for ( let i = 0; i < split.length; i += 1 ) {\n const currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n\n /**\n * @param name Cookie name\n * @param value Cookie value\n * @param expires Number of days until the cookies expires or an actual `Date`\n * @param path Cookie path\n * @param domain Cookie domain\n * @param secure Secure flag\n * @param sameSite OWASP samesite token `Lax` or `Strict`\n */\n set(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite
|
|
1
|
+
{"version":3,"file":"ngx-cookie-service.umd.min.js","sources":["~/ngx-cookie-service/lib/cookie-service/cookie.service.ts"],"sourcesContent":["// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\n\n@Injectable()\nexport class CookieService {\n private readonly documentIsAccessible: boolean;\n\n constructor(\n // The type `Document` may not be used here. Although a fix is on its way,\n // we will go with `any` for now to support Angular 2.4.x projects.\n // Issue: https://github.com/angular/angular/issues/12631\n // Fix: https://github.com/angular/angular/pull/14894\n @Inject( DOCUMENT ) private document: any,\n // Get the `PLATFORM_ID` so we can check if we're in a browser.\n @Inject( PLATFORM_ID ) private platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n\n /**\n * @param name Cookie name\n * @returns {boolean}\n */\n check( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const regExp: RegExp = this.getCookieRegExp( name );\n const exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n\n /**\n * @param name Cookie name\n * @returns {any}\n */\n get( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const regExp: RegExp = this.getCookieRegExp( name );\n const result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n\n /**\n * @returns {}\n */\n getAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const cookies: {} = {};\n const document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const split: Array<string> = document.cookie.split(';');\n\n for ( let i = 0; i < split.length; i += 1 ) {\n const currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n\n /**\n * @param name Cookie name\n * @param value Cookie value\n * @param expires Number of days until the cookies expires or an actual `Date`\n * @param path Cookie path\n * @param domain Cookie domain\n * @param secure Secure flag\n * @param sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `None`\n */\n set(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite: 'Lax' | 'None' | 'Strict' = 'None'\n ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n let cookieString: string = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';';\n\n if ( expires ) {\n if ( typeof expires === 'number' ) {\n const dateExpires: Date = new Date( new Date().getTime() + expires * 1000 * 60 * 60 * 24 );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + expires.toUTCString() + ';';\n }\n }\n\n if ( path ) {\n cookieString += 'path=' + path + ';';\n }\n\n if ( domain ) {\n cookieString += 'domain=' + domain + ';';\n }\n\n if ( secure ) {\n cookieString += 'secure;';\n }\n\n cookieString += 'sameSite=' + sameSite + ';';\n\n this.document.cookie = cookieString;\n }\n\n /**\n * @param name Cookie name\n * @param path Cookie path\n * @param domain Cookie domain\n */\n delete( name: string, path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n this.set( name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain );\n }\n\n /**\n * @param path Cookie path\n * @param domain Cookie domain\n */\n deleteAll( path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n const cookies: any = this.getAll();\n\n for ( const cookieName in cookies ) {\n if ( cookies.hasOwnProperty( cookieName ) ) {\n this.delete( cookieName, path, domain );\n }\n }\n }\n\n /**\n * @param name Cookie name\n * @returns {RegExp}\n */\n private getCookieRegExp( name: string ): RegExp {\n const escapedName: string = name.replace( /([\\[\\]\\{\\}\\(\\)\\|\\=\\;\\+\\?\\,\\.\\*\\^\\$])/ig, '\\\\$1' );\n\n return new RegExp( '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g' );\n }\n}\n"],"names":["CookieService","prototype","check","name","this","documentIsAccessible","encodeURIComponent","getCookieRegExp","test","document","cookie","get","result","exec","decodeURIComponent","getAll","cookies","split","i","length","currentCookie","replace","set","value","expires","path","domain","secure","sameSite","cookieString","Date","getTime","toUTCString","delete","deleteAll","cookieName","hasOwnProperty","escapedName","RegExp","platformId","isPlatformBrowser","decorators","type","Injectable","ctorParameters","undefined","Inject","args","DOCUMENT","InjectionToken","PLATFORM_ID"],"mappings":"wTAKA,IAAAA,GAkBAA,EAAAC,UAAAC,MAAA,SAIGC,GAHC,QAIKC,KAAMC,uBAAXF,EAIOG,mBAAoBH,GAEJC,KAAKG,gBAAiBJ,GACdK,KAAMJ,KAAKK,SAASC,UAIvDV,EAAAC,UAAAU,IAAA,SAKGR,GAJC,GAKKC,KAAKC,sBAAwBD,KAAKF,MAAOC,GAAS,CAJrDA,EAKOG,mBAAoBH,GAH3B,IAMMS,EADiBR,KAAKG,gBAAiBJ,GACNU,KAAMT,KAAKK,SAASC,QAH3D,OAKOI,mBAAoBF,EAAQ,IAHnC,MAKO,IACbZ,EAAAC,UAAAc,OAAA,WACI,IAMKX,KAAMC,qBALT,MAMO,GAHT,IAMMW,EAAc,GACdP,EAAgBL,KAAKK,SAJ3B,GAMKA,EAASC,QAA8B,KAApBD,EAASC,OAH/B,IAFA,IAMMO,EAAuBR,EAASC,OAAOO,MAAM,KAEzCC,EAAI,EAAGA,EAAID,EAAME,OAAQD,GAAK,EAAI,CAL1C,IAMME,EAA+BH,EAAOC,GAAID,MAAM,KAJtDG,EAMe,GAAMA,EAAe,GAAIC,QAAS,KAAM,IALvDL,EAMSF,mBAAoBM,EAAe,KAAUN,mBAAoBM,EAAe,IAF7F,OAMOJ,GAMXhB,EAAAC,UAAAqB,IAAA,SACInB,EACAoB,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,QAFJ,IAAAA,IAAIA,EAAJ,QAQSxB,KAAMC,qBANX,CAIA,IAMIwB,EAAuBvB,mBAAoBH,GAAS,IAAMG,mBAAoBiB,GAAU,IAEvFC,IAFDK,GAGsB,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
26
|
* @param domain Cookie domain
|
|
27
27
|
* @param secure Secure flag
|
|
28
|
-
* @param sameSite OWASP samesite token `Lax` or `Strict`
|
|
28
|
+
* @param sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `None`
|
|
29
29
|
*/
|
|
30
|
-
set(name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'Strict'): void;
|
|
30
|
+
set(name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'None' | 'Strict'): void;
|
|
31
31
|
/**
|
|
32
32
|
* @param name Cookie name
|
|
33
33
|
* @param path Cookie path
|
|
@@ -67,10 +67,11 @@ var CookieService = (function () {
|
|
|
67
67
|
* @param {?=} path Cookie path
|
|
68
68
|
* @param {?=} domain Cookie domain
|
|
69
69
|
* @param {?=} secure Secure flag
|
|
70
|
-
* @param {?=} sameSite OWASP samesite token `Lax` or `Strict`
|
|
70
|
+
* @param {?=} sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `None`
|
|
71
71
|
* @return {?}
|
|
72
72
|
*/
|
|
73
73
|
CookieService.prototype.set = function (name, value, expires, path, domain, secure, sameSite) {
|
|
74
|
+
if (sameSite === void 0) { sameSite = 'None'; }
|
|
74
75
|
if (!this.documentIsAccessible) {
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
@@ -93,9 +94,7 @@ var CookieService = (function () {
|
|
|
93
94
|
if (secure) {
|
|
94
95
|
cookieString += 'secure;';
|
|
95
96
|
}
|
|
96
|
-
|
|
97
|
-
cookieString += 'sameSite=' + sameSite + ';';
|
|
98
|
-
}
|
|
97
|
+
cookieString += 'sameSite=' + sameSite + ';';
|
|
99
98
|
this.document.cookie = cookieString;
|
|
100
99
|
};
|
|
101
100
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-cookie-service.es5.js","sources":["ts/lib/ngx-cookie-service.ts","ts/lib/cookie-service/cookie.service.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {CookieService} from './index';\n","// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nexport class CookieService {\nprivate readonly documentIsAccessible: boolean;\n/**\n * @param {?} document\n * @param {?} platformId\n */\nconstructor(\nprivate document: any,\nprivate platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\ncheck( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nget( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n/**\n * @return {?}\n */\ngetAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const /** @type {?} */ cookies: {} = {};\n const /** @type {?} */ document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const /** @type {?} */ split: Array<string> = document.cookie.split(';');\n\n for ( let /** @type {?} */ i = 0; i < split.length; i += 1 ) {\n const /** @type {?} */ currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n/**\n * @param {?} name Cookie name\n * @param {?} value Cookie value\n * @param {?=} expires Number of days until the cookies expires or an actual `Date`\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @param {?=} secure Secure flag\n * @param {?=} sameSite OWASP samesite token `Lax` or `Strict`\n * @return {?}\n */\nset(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite?: 'Lax' | 'Strict'\n ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n let /** @type {?} */ cookieString: string = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';';\n\n if ( expires ) {\n if ( typeof expires === 'number' ) {\n const /** @type {?} */ dateExpires: Date = new Date( new Date().getTime() + expires * 1000 * 60 * 60 * 24 );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + expires.toUTCString() + ';';\n }\n }\n\n if ( path ) {\n cookieString += 'path=' + path + ';';\n }\n\n if ( domain ) {\n cookieString += 'domain=' + domain + ';';\n }\n\n if ( secure ) {\n cookieString += 'secure;';\n }\n\n if ( sameSite ) {\n cookieString += 'sameSite=' + sameSite + ';';\n }\n\n this.document.cookie = cookieString;\n }\n/**\n * @param {?} name Cookie name\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndelete( name: string, path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n this.set( name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain );\n }\n/**\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndeleteAll( path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n const /** @type {?} */ cookies: any = this.getAll();\n\n for ( const /** @type {?} */ cookieName in cookies ) {\n if ( cookies.hasOwnProperty( cookieName ) ) {\n this.delete( cookieName, path, domain );\n }\n }\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nprivate getCookieRegExp( name: string ): RegExp {\n const /** @type {?} */ escapedName: string = name.replace( /([\\[\\]\\{\\}\\(\\)\\|\\=\\;\\+\\?\\,\\.\\*\\^\\$])/ig, '\\\\$1' );\n\n return new RegExp( '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g' );\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: undefined, decorators: [{ type: Inject, args: [DOCUMENT, ] }, ]},\n{type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID, ] }, ]},\n];\n}\n\nfunction CookieService_tsickle_Closure_declarations() {\n/** @type {?} */\nCookieService.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nCookieService.ctorParameters;\n/** @type {?} */\nCookieService.prototype.documentIsAccessible;\n/** @type {?} */\nCookieService.prototype.document;\n/** @type {?} */\nCookieService.prototype.platformId;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"],"names":[],"mappings":";;ACAA,2FAAA;;;AAKA;;;;;IAQA,uBAGa,QAAU,EAEV,UAAkC;QAFlC,IAAb,CAAA,QAAa,GAAA,QAAA,CAAU;QAEV,IAAb,CAAA,UAAa,GAAA,UAAA,CAAkC;QAD3C,IAAI,CAAC,oBAAoB,GAAG,iBAAiB,CAAE,IAAI,CAAC,UAAU,CAAE,CAAC;IACrE,CAAG;;;;;IAKH,6BAIG,GAJH,UAIG,IAAA;QAHC,EAAJ,CAAA,CAIS,CAAA,IAAE,CAAI,oBAAqB,CAJpC,CAIsC,CAJtC;YACM,MAAN,CAIa,KAAA,CAAM;QAHnB,CAAK;QAED,IAAI,GAIG,kBAAA,CAAoB,IAAA,CAAK,CAAE;QAFlC,IAAJ,gBAAA,CAIU,MAAA,GAAiB,IAAA,CAAK,eAAC,CAAgB,IAAA,CAAK,CAAE;QAHpD,I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MAAC,CAAO,UAAA,EAAY,IAAA,EAAM,MAAA,CAAO,CAAE;YALhD,CAAO;QACP,CAAK;IACL,CAAG;;;;;IAYA,uCAAA,GAAA,UAAA,IAAA;QANC,IAAJ,gBAAA,CAOU,WAAA,GAAsB,IAAA,CAAK,OAAC,CAAQ,wCAAA,EAA0C,MAAA,CAAO,CAAE;QAL7F,MAAJ,CAOW,IAAI,MAAA,CAAQ,MAAA,GAAS,WAAA,GAAc,QAAA,GAAW,WAAA,GAAc,gBAAA,EAAkB,GAAA,CAAI,CAAE;IAN/F,CAAG;;CAlKH;AA0KO,aAAP,CAAA,UAAO,GAAoC;IAN3C,EAOE,IAAA,EAAM,UAAA,EAAW;CANlB,CAOC;;;;AAED,aAAD,CAAA,cAAC,GAAA,cAAA,OAAA;IAJD,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAG,EAAE,EAAG,EAAC;IACvE,EAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,WAAW,EAAG,EAAE,EAAG,EAAC;CAC9E,EAEA,CAFA,CAAC;ADjLF;;GAEG;"}
|
|
1
|
+
{"version":3,"file":"ngx-cookie-service.es5.js","sources":["ts/lib/ngx-cookie-service.ts","ts/lib/cookie-service/cookie.service.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {CookieService} from './index';\n","// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nexport class CookieService {\nprivate readonly documentIsAccessible: boolean;\n/**\n * @param {?} document\n * @param {?} platformId\n */\nconstructor(\nprivate document: any,\nprivate platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\ncheck( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nget( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n/**\n * @return {?}\n */\ngetAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const /** @type {?} */ cookies: {} = {};\n const /** @type {?} */ document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const /** @type {?} */ split: Array<string> = document.cookie.split(';');\n\n for ( let /** @type {?} */ i = 0; i < split.length; i += 1 ) {\n const /** @type {?} */ currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n/**\n * @param {?} name Cookie name\n * @param {?} value Cookie value\n * @param {?=} expires Number of days until the cookies expires or an actual `Date`\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @param {?=} secure Secure flag\n * @param {?=} sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `None`\n * @return {?}\n */\nset(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite: 'Lax' | 'None' | 'Strict' = 'None'\n ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n let /** @type {?} */ cookieString: string = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';';\n\n if ( expires ) {\n if ( typeof expires === 'number' ) {\n const /** @type {?} */ dateExpires: Date = new Date( new Date().getTime() + expires * 1000 * 60 * 60 * 24 );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + expires.toUTCString() + ';';\n }\n }\n\n if ( path ) {\n cookieString += 'path=' + path + ';';\n }\n\n if ( domain ) {\n cookieString += 'domain=' + domain + ';';\n }\n\n if ( secure ) {\n cookieString += 'secure;';\n }\n\n cookieString += 'sameSite=' + sameSite + ';';\n\n this.document.cookie = cookieString;\n }\n/**\n * @param {?} name Cookie name\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndelete( name: string, path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n this.set( name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain );\n }\n/**\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndeleteAll( path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n const /** @type {?} */ cookies: any = this.getAll();\n\n for ( const /** @type {?} */ cookieName in cookies ) {\n if ( cookies.hasOwnProperty( cookieName ) ) {\n this.delete( cookieName, path, domain );\n }\n }\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nprivate getCookieRegExp( name: string ): RegExp {\n const /** @type {?} */ escapedName: string = name.replace( /([\\[\\]\\{\\}\\(\\)\\|\\=\\;\\+\\?\\,\\.\\*\\^\\$])/ig, '\\\\$1' );\n\n return new RegExp( '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g' );\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: undefined, decorators: [{ type: Inject, args: [DOCUMENT, ] }, ]},\n{type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID, ] }, ]},\n];\n}\n\nfunction CookieService_tsickle_Closure_declarations() {\n/** @type {?} */\nCookieService.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nCookieService.ctorParameters;\n/** @type {?} */\nCookieService.prototype.documentIsAccessible;\n/** @type {?} */\nCookieService.prototype.document;\n/** @type {?} */\nCookieService.prototype.platformId;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"],"names":[],"mappings":";;ACAA,2FAAA;;;AAKA;;;;;IAQA,uBAGa,QAAU,EAEV,UAAkC;QAFlC,IAAb,CAAA,QAAa,GAAA,QAAA,CAAU;QAEV,IAAb,CAAA,UAAa,GAAA,UAAA,CAAkC;QAD3C,IAAI,CAAC,oBAAoB,GAAG,iBAAiB,CAAE,IAAI,CAAC,UAAU,CAAE,CAAC;IACrE,CAAG;;;;;IAKH,6BAIG,GAJH,UAIG,IAAA;QAHC,EAAJ,CAAA,CAIS,CAAA,IAAE,CAAI,oBAAqB,CAJpC,CAIsC,CAJtC;YACM,MAAN,CAIa,KAAA,CAAM;QAHnB,CAAK;QAED,IAAI,GAIG,kBAAA,CAAoB,IAAA,CAAK,CAAE;QAFlC,IAAJ,gBAAA,CAIU,MAAA,GAAiB,IAAA,CAAK,eAAC,CAAgB,IAAA,CAAK,CAAE;QAHpD,IAAJ,gBAAA,CAIU,MAAA,GAAkB,MAAA,CAAO,IAAC,CAAK,IAAA,CAAK,QAAC,CAAQ,MAAC,CAAM,CAAE;QAF5D,MAAJ,CAIW,MAAA,CAAO;IAHlB,CAAG;;;;;IAKH,2BAKG,GALH,UAKG,IAAA;QAJC,EAAJ,CAAA,CAKS,IAAA,CAAK,oBAAC,IAAuB,IAAA,CAAK,KAAC,CAAM,IAAA,CAAO,CALzD,CAK2D,CAL3D;YACM,IAAI,GAKG,kBAAA,CAAoB,IAAA,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CAhKH;AAwKO,aAAP,CAAA,UAAO,GAAoC;IAN3C,EAOE,IAAA,EAAM,UAAA,EAAW;CANlB,CAOC;;;;AAED,aAAD,CAAA,cAAC,GAAA,cAAA,OAAA;IAJD,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAG,EAAE,EAAG,EAAC;IACvE,EAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,WAAW,EAAG,EAAE,EAAG,EAAC;CAC9E,EAEA,CAFA,CAAC;AD/KF;;GAEG;"}
|
package/ngx-cookie-service.js
CHANGED
|
@@ -68,10 +68,10 @@ class CookieService {
|
|
|
68
68
|
* @param {?=} path Cookie path
|
|
69
69
|
* @param {?=} domain Cookie domain
|
|
70
70
|
* @param {?=} secure Secure flag
|
|
71
|
-
* @param {?=} sameSite OWASP samesite token `Lax` or `Strict`
|
|
71
|
+
* @param {?=} sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `None`
|
|
72
72
|
* @return {?}
|
|
73
73
|
*/
|
|
74
|
-
set(name, value, expires, path, domain, secure, sameSite) {
|
|
74
|
+
set(name, value, expires, path, domain, secure, sameSite = 'None') {
|
|
75
75
|
if (!this.documentIsAccessible) {
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
@@ -94,9 +94,7 @@ class CookieService {
|
|
|
94
94
|
if (secure) {
|
|
95
95
|
cookieString += 'secure;';
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
cookieString += 'sameSite=' + sameSite + ';';
|
|
99
|
-
}
|
|
97
|
+
cookieString += 'sameSite=' + sameSite + ';';
|
|
100
98
|
this.document.cookie = cookieString;
|
|
101
99
|
}
|
|
102
100
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-cookie-service.js","sources":["ts/lib/ngx-cookie-service.ts","ts/lib/cookie-service/cookie.service.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {CookieService} from './index';\n","// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nexport class CookieService {\nprivate readonly documentIsAccessible: boolean;\n/**\n * @param {?} document\n * @param {?} platformId\n */\nconstructor(\nprivate document: any,\nprivate platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\ncheck( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nget( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n/**\n * @return {?}\n */\ngetAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const /** @type {?} */ cookies: {} = {};\n const /** @type {?} */ document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const /** @type {?} */ split: Array<string> = document.cookie.split(';');\n\n for ( let /** @type {?} */ i = 0; i < split.length; i += 1 ) {\n const /** @type {?} */ currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n/**\n * @param {?} name Cookie name\n * @param {?} value Cookie value\n * @param {?=} expires Number of days until the cookies expires or an actual `Date`\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @param {?=} secure Secure flag\n * @param {?=} sameSite OWASP samesite token `Lax` or `Strict`\n * @return {?}\n */\nset(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite
|
|
1
|
+
{"version":3,"file":"ngx-cookie-service.js","sources":["ts/lib/ngx-cookie-service.ts","ts/lib/cookie-service/cookie.service.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {CookieService} from './index';\n","// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nexport class CookieService {\nprivate readonly documentIsAccessible: boolean;\n/**\n * @param {?} document\n * @param {?} platformId\n */\nconstructor(\nprivate document: any,\nprivate platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\ncheck( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nget( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n/**\n * @return {?}\n */\ngetAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const /** @type {?} */ cookies: {} = {};\n const /** @type {?} */ document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const /** @type {?} */ split: Array<string> = document.cookie.split(';');\n\n for ( let /** @type {?} */ i = 0; i < split.length; i += 1 ) {\n const /** @type {?} */ currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n/**\n * @param {?} name Cookie name\n * @param {?} value Cookie value\n * @param {?=} expires Number of days until the cookies expires or an actual `Date`\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @param {?=} secure Secure flag\n * @param {?=} sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `None`\n * @return {?}\n */\nset(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite: 'Lax' | 'None' | 'Strict' = 'None'\n ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n let /** @type {?} */ cookieString: string = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';';\n\n if ( expires ) {\n if ( typeof expires === 'number' ) {\n const /** @type {?} */ dateExpires: Date = new Date( new Date().getTime() + expires * 1000 * 60 * 60 * 24 );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + expires.toUTCString() + ';';\n }\n }\n\n if ( path ) {\n cookieString += 'path=' + path + ';';\n }\n\n if ( domain ) {\n cookieString += 'domain=' + domain + ';';\n }\n\n if ( secure ) {\n cookieString += 'secure;';\n }\n\n cookieString += 'sameSite=' + sameSite + ';';\n\n this.document.cookie = cookieString;\n }\n/**\n * @param {?} name Cookie name\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndelete( name: string, path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n this.set( name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain );\n }\n/**\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndeleteAll( path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n const /** @type {?} */ cookies: any = this.getAll();\n\n for ( const /** @type {?} */ cookieName in cookies ) {\n if ( cookies.hasOwnProperty( cookieName ) ) {\n this.delete( cookieName, path, domain );\n }\n }\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nprivate getCookieRegExp( name: string ): RegExp {\n const /** @type {?} */ escapedName: string = name.replace( /([\\[\\]\\{\\}\\(\\)\\|\\=\\;\\+\\?\\,\\.\\*\\^\\$])/ig, '\\\\$1' );\n\n return new RegExp( '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g' );\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: undefined, decorators: [{ type: Inject, args: [DOCUMENT, ] }, ]},\n{type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID, ] }, ]},\n];\n}\n\nfunction CookieService_tsickle_Closure_declarations() {\n/** @type {?} */\nCookieService.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nCookieService.ctorParameters;\n/** @type {?} */\nCookieService.prototype.documentIsAccessible;\n/** @type {?} */\nCookieService.prototype.document;\n/** @type {?} */\nCookieService.prototype.platformId;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"],"names":[],"mappings":";;;ACAA;;;AAKA,AAEA,MAAA,aAAA,CAAA;;;;;IAMA,WAAA,CAGa,QAAU,EAEV,UAAkC,EAL/C;QAGa,IAAb,CAAA,QAAa,GAAA,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EAAW;CANlB,CAOC;;;;AAED,aAAD,CAAA,cAAC,GAAA,MAAA;IAJD,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAG,EAAE,EAAG,EAAC;IACvE,EAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,WAAW,EAAG,EAAE,EAAG,EAAC;CAC9E,CAAC;;AD/KF;;GAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ngx-cookie-service","description":"an (aot ready) angular (4.2+) cookie service","version":"2.
|
|
1
|
+
{"name":"ngx-cookie-service","description":"an (aot ready) angular (4.2+) cookie service","version":"2.3.0","license":"MIT","author":"7leads GmbH <info@7leads.org>","keywords":["angular","angular2","angular4","angular5","angular-2","angular-4","angular-5","angular-6","angular-7","aot","aot-compatible","aot-compilation","ngx","ng2","ng","service","angular-service","cookie-service","cookie","cookies"],"contributors":[{"name":"Christopher Parotat","email":"c.parotat@7leads.org"},{"name":"Stefan Bauer","email":"bauer.stefan@live.de"},{"name":"Kristian Thy","email":"thy@42.dk"},{"name":"Jared Clemence"},{"name":"flakolefluk"},{"name":"mattbanks"},{"name":"DBaker85"},{"name":"Matt Lewis","email":"npm@mattlewis.me"},{"name":"IceBreakerG"}],"scripts":{"ng":"ng","start":"npm run compile && ng serve","build":"npm run compile && ng build","test":"npm run compile && ng test","lint":"npm run compile && ng lint","e2e":"npm run compile && ng e2e","compile":"ng-packagr -p ng-package.json","publish:dist":"npm run compile && npm publish dist-lib"},"repository":{"type":"git","url":"https://github.com/7leads/ngx-cookie-service.git"},"bugs":{"url":"https://github.com/7leads/ngx-cookie-service/issues","email":"info@7leads.org"},"peerDependencies":{"@angular/core":">=4.2.0","@angular/platform-browser":">=4.2.0","@angular/platform-browser-dynamic":">=4.2.0"},"devDependencies":{"@angular/cli":"1.0.0","@angular/common":"^4.0.0","@angular/compiler":"^4.0.0","@angular/compiler-cli":"^4.0.0","@angular/core":"^4.0.0","@angular/forms":"^4.0.0","@angular/http":"^4.0.0","@angular/platform-browser":"^4.0.0","@angular/platform-browser-dynamic":"^4.0.0","@angular/platform-server":"^4.0.0","@angular/router":"^4.0.0","@types/jasmine":"2.5.38","@types/node":"~6.0.60","async":"^2.3.0","codelyzer":"~2.0.0","core-js":"^2.4.1","jasmine-core":"~2.5.2","jasmine-spec-reporter":"~3.2.0","karma":"~1.4.1","karma-chrome-launcher":"~2.0.0","karma-cli":"~1.0.1","karma-coverage-istanbul-reporter":"^0.2.0","karma-jasmine":"~1.1.0","karma-jasmine-html-reporter":"^0.2.2","ng-packagr":"^1.7.0","protractor":"~5.1.0","rimraf":"^2.6.1","rxjs":"^5.1.0","ts-node":"~2.0.0","tslint":"~4.5.0","typescript":"~2.2.0","zone.js":"^0.8.4"},"main":"bundles/ngx-cookie-service.umd.js","module":"ngx-cookie-service.es5.js","es2015":"ngx-cookie-service.js","typings":"ngx-cookie-service.d.ts","metadata":"ngx-cookie-service.metadata.json"}
|