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

delete session and delete user not working.. #34

Open
surfjedi opened this issue Jul 3, 2018 · 4 comments
Open

delete session and delete user not working.. #34

surfjedi opened this issue Jul 3, 2018 · 4 comments

Comments

@surfjedi
Copy link

surfjedi commented Jul 3, 2018

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();
@austencm
Copy link

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.

@curtisolson
Copy link

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
Copy link

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

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

@NotTooReact89
Copy link

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

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

No branches or pull requests

4 participants