redux-react-session icon indicating copy to clipboard operation
redux-react-session copied to clipboard

delete session and delete user not working..

Open surfjedi opened this issue 7 years ago • 4 comments

Has any one else experienced deleteSession() or deleteUser() not working?

Are there any working examples?

This is what I'm using but it doesn't affect any cookies, etc

    sessionService.deleteSession();
    sessionService.deleteUser();

surfjedi avatar Jul 03 '18 15:07 surfjedi

Working for me. I'm using it like this:

sessionService.deleteSession().then(() => sessionService.deleteUser());

Not sure this way is necessary or better, though. This library is great but could definitely use better docs.

austencm avatar Jul 17 '18 19:07 austencm

I'm seeing odd behavior as well. At logout, I call api to do server logout, delete session and user and then update store.

  userService.logout()
    .then(() => {
      sessionService.deleteSession();
      sessionService.deleteUser();
      dispatch({ type: userConstants.LOGOUT });

After debugging, redux-react-session is telling me that the session is gone, but I still see it in IndexedDB. I'm using default storage, so session and user are stored in IndexedDB>redux-react-session>keyvaluepairs.

I'm worried that if those values aren't cleared that they'll somehow be reloaded. So technically, this works, but I'm afraid I'll get a bug later that will be hard to find. Also, from a debugging standpoint, it would be nice to look in developer tools and tell whether I have a session or not.

curtisolson avatar Sep 26 '18 16:09 curtisolson

I just changed storage methods and now I'm seeing the behavior I expected.

From sessionService.initSessionService(store); To sessionService.initSessionService(store, { driver: 'COOKIES' });

curtisolson avatar Sep 26 '18 16:09 curtisolson

I am still experiencing this issue. When I reload my page GET_SESSION_SUCCESS gets called automatically

NotTooReact89 avatar Jun 28 '19 09:06 NotTooReact89