using useSession hook
is it good to call useSession many times or make useSession globally, im still kinda new so need a lot of advice and guidance thanksss
4 Replies
because i want use dashboard layout that have username and user image
and whats the best practice calling useSession
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
My stance on this depends on what your purpose is for the usage. For instance, if all you need to do is protect the page from unauthorized access, then do something like this in get getServerSideProps:
i think this can clear my worry about useSession thanks @Psych0F0x @amanuel