0

I'm currently facing a problem with parse(parse-1.3.1) and the safari mobile browser with iOS 8. If i try to to login an user with following code:

function login() {
    var login=$("#loginTB").val();
    var password=$("#passwordTB").val();
    Parse.User.logIn(login.toLowerCase(), password, {
  success: function(user) {
    // Do stuff after successful login.
    console.log("successfully logged in");

        //var sessionToken = Parse.User.current()._sessionToken;
        //createCookie("sessionToken",sessionToken,7);
        window.location.href = menuLocation;
      },
      error: function(user, error) {
        // The login failed. Check error to see why.
        alert("Error: " + error.code + " " + error.message);
      }

});

}

i get this error:

[Error] QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.
    setItem (parse-1.3.1.min.js, line 1)
    _getInstallationId (parse-1.3.1.min.js, line 1)
    _request (parse-1.3.1.min.js, line 1)
    logIn (parse-1.3.1.min.js, line 3)
    logIn (parse-1.3.1.min.js, line 3)
    login (login.html, line 162)
    onclick (login.html, line 1)
[Error] QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.
    setItem (parse-1.3.1.min.js, line 3)
    _saveCurrentUser (parse-1.3.1.min.js, line 3)
    _handleSaveResult (parse-1.3.1.min.js, line 3)
    (anonyme Funktion) (parse-1.3.1.min.js, line 3)
    e (parse-1.3.1.min.js, line 2)
    (anonyme Funktion) (parse-1.3.1.min.js, line 2)
    forEach ([native code], line 0)
    forEach (parse-1.3.1.min.js, line 1)
    resolve (parse-1.3.1.min.js, line 2)
    e (parse-1.3.1.min.js, line 2)
    (anonyme Funktion) (parse-1.3.1.min.js, line 2)
    forEach ([native code], line 0)
    forEach (parse-1.3.1.min.js, line 1)
    resolve (parse-1.3.1.min.js, line 2)
    (anonyme Funktion) (parse-1.3.1.min.js, line 2)
    e (parse-1.3.1.min.js, line 2)
    (anonyme Funktion) (parse-1.3.1.min.js, line 2)
    g (parse-1.3.1.min.js, line 2)
    then (parse-1.3.1.min.js, line 2)
    e (parse-1.3.1.min.js, line 2)
    (anonyme Funktion) (parse-1.3.1.min.js, line 2)
    forEach ([native code], line 0)
    forEach (parse-1.3.1.min.js, line 1)
    resolve (parse-1.3.1.min.js, line 2)
    onreadystatechange (parse-1.3.1.min.js, line 1)

I´ve read that there could be a problem with the access of the local storage...

Peet Zahut
  • 43
  • 1
  • 7

1 Answers1

0

I faced a similar issue with parse. In Safari Private browsing it disables Local Storage and Parse relies on storing user data in Local Storage. So when I made this call var currentUser = Parse.User.current(); currentUser was set to null and I was getting the same exact error you are seeing.

According to this Parse Discussion you could check if local storage is not available and then use a fallback solution as described here.

Community
  • 1
  • 1
jjbskir
  • 8,474
  • 9
  • 40
  • 53