Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Safari Privacy Browsing, basil.reset() is not clearing out things stored in cookie #45

Open
dennishuh opened this issue Feb 15, 2017 · 3 comments

Comments

@dennishuh
Copy link

In regular browsing, basil.reset() gets rid of all inputs because we're using session storage, but in safari private browsing, sessionStorage and localStorage are both forbidden, so we write to the cookie, but reset() is not clearing those out.

Any ideas on why that is?

@guillaumepotier
Copy link
Member

Hi there,

Strange to read that. Do you run it in Safari desktop or mobile ? Could you provide maybe a jsfiddle ou jsbin I could run to show the issue and start debugging?

Best

@dennishuh
Copy link
Author

http://jsbin.com/ripivolawe/1/edit?html,js,console

I thought basil would automatically check to see if it can write to session if not move onto cookie, but it seems as though it doesn't move onto cookies in this jsbin.

I'm on safari 9.1.2 on macOS10.11.6 desktop.

Let me know if you find anything.

Thank you!

@guillaumepotier
Copy link
Member

Hum. Cannot run JSbin in private mode, there is a localstorage error (that's why basil here after all ;))
Are you sure you really run it in private mode. You don't have the error too?

I made that little snippet to test on my computer:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/basil.js/0.4.4/basil.min.js"></script>
  </head>
<body>
<script type="text/javascript">
    var __log = function (log, replace) {
      document.write('> ' + log.replace('%s', replace) + '<br/>');
    }

    var basil = new Basil({storages: ['session', 'cookie']});
    __log('saved start on page loading: <strong>%s</strong> (should be null)', basil.get('start'));

    __log('setting start to true');
    basil.set('start', true);

    __log('start value now: <strong>%s</strong> (should be true)', basil.get('start'));

    __log('resetting now');
    basil.reset();

    __log('start status after reset: <strong>%s</strong> (should be null)', basil.get('start'));
</script>
</body>
</html>

And it is perfectly working on my side on Safari 9.1 (11601.5.17.1) and MacOS 10.11.4 (15E65).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants