Authentication Not Working In Safari

The users can successfully login but the localStorage is not being set in Safari. It works in the other browsers.
localStorage.setItem(‘accessToken’, authResult.accessToken);
If I check the Local Storage in Safari it is null.