Closed stipsan closed 8 years ago
@stipsan A PR would be welcome since I don't have Safari to test (I'm using Ubuntu). I guess we should add the new lines underneath https://github.com/SocketCluster/socketcluster-client/blob/a65b40bf8cd8327a3184d9b9e4883b292c7b5900/lib/auth.js#L9 (still inside the same try catch block). We should avoid setting a generic key name like 'localStorage' (we don't want to overwrite anything that might be in there from before) - Maybe something like:
localStorage.setItem('__scLocalStorageTest', 1);
localStorage.removeItem('__scLocalStorageTest');
Sure no problem! I'll submit a PR in a few hours
How to reproduce,
I have a personal project setup where this bug can be reproduced in a few steps:
Sample fix
If we update this: https://github.com/SocketCluster/socketcluster-client/blob/a65b40bf8cd8327a3184d9b9e4883b292c7b5900/lib/auth.js#L9 With something like this: https://gist.github.com/philfreo/68ea3cd980d72383c951 The problem is solved.
I didn't have the time to fork and submit a PR with the fix, but thought I'd share this and my findings and submit a PR later if nobody beats me to it :smile: