useSession() not getting the updated session after logout and re login #10985
-
I am trying to implement add to Wishlist feature. I wanted that when use click on the "add to wishlist" btn(client component) update the session and catch the updated session in the header and show the number of the wish list items. It working fine when I stayed login. But when I logout then server component's session becomes null but the client component still holding the previous login state. I mean wishlist show the number. But it should be 0 because the session doesn't exist. But if i reload the tab then the session is available inside the client component session |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is how I fixed the problem.
|
Beta Was this translation helpful? Give feedback.
This is how I fixed the problem.