mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2139] extra cookie availability check (#2865)
* extra cookie availability check * code style and test fixes * unit tests
This commit is contained in:
committed by
Eugenio Romano
parent
900fd70d63
commit
49456b3fcd
@@ -20,6 +20,16 @@ import { Injectable } from '@angular/core';
|
||||
@Injectable()
|
||||
export class CookieService {
|
||||
|
||||
isEnabled(): boolean {
|
||||
// for certain scenarios Chrome may say 'true' but have cookies still disabled
|
||||
if (navigator.cookieEnabled === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
document.cookie = 'test-cookie';
|
||||
return document.cookie.indexOf('test-cookie') > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve cookie by key.
|
||||
*
|
||||
|
Reference in New Issue
Block a user