Skip to content

session.data.expires undefined first time using useSession in v4 #12197

Discussion options

You must be logged in to vote

@jmpena2011
Okay, if this is the case, you can may use the session.update() method. This solution is not as clean as the jwt one, but in this case it's your best possible solution i guess.

useEffect(() => {
  if (!session.expires) {
    session.update();
  }
}, [session]);

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jmpena2011
Comment options

@jonas-is-coding
Comment options

Answer selected by jmpena2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants