Support for when cookies are disabled

HFJ-1915
pull/23/head
Frode Petterson 2016-06-20 14:57:14 +02:00
parent d4d9f81518
commit a6656c2e6f
1 changed files with 16 additions and 10 deletions

View File

@ -188,12 +188,18 @@ H5P.XAPIEvent.prototype.setActor = function () {
}
else {
var uuid;
if (localStorage.H5PUserUUID) {
uuid = localStorage.H5PUserUUID;
try {
if (localStorage.H5PUserUUID) {
uuid = localStorage.H5PUserUUID;
}
else {
uuid = H5P.createUUID();
localStorage.H5PUserUUID = uuid;
}
}
else {
uuid = H5P.createUUID();
localStorage.H5PUserUUID = uuid;
catch (err) {
// LocalStorage and Cookies are probably disabled. Do not track the user.
uuid = 'not-trackable-' + H5P.createUUID();
}
this.data.statement.actor = {
'account': {