Wisembly / basil.js

The missing Javascript smart persistent layer
https://wisembly.github.io/basil.js
Other
1.98k stars 62 forks source link

remove from cookies does not work for me #58

Open alexander-elgin opened 4 years ago

guillaumepotier commented 4 years ago

Hum,

this is really strange since we're using basil on production for years now on Wisembly and cookies are correctly removed when a signed in users logs out.

Please, would you mind sharing with us an example of what you're saying?

Thx

alexander-elgin commented 4 years ago

That's how I use it

import Basil from 'basil.js';

const BASIC_STORAGE_NAME = 'CURRENT_USER';
const TOKEN_STORAGE_NAME = 'TOKEN';

const basil = new Basil({
  storages: ['cookie'],
  namespace: BASIC_STORAGE_NAME,
});

export function getToken() {
  return basil.get(TOKEN_STORAGE_NAME);
}

export function setToken(token) {
  basil.set(TOKEN_STORAGE_NAME, token);
}

export function signOut() {
  basil.remove(TOKEN_STORAGE_NAME);
}

on Chrome Chrome 76, Ubuntu 16.04 OS (64 bit)

guillaumepotier commented 4 years ago

Ok,

Your class seems ok so far.

Please, could you use https://jsfiddle.net/ to create a snippet showing the bug please?

Best