https://supertokens.com/ logo
k

kelbs

04/10/2022, 4:08 PM
Does frontend function
doesSessionExist()
make a network call? If we're building our own frontend UI, how is doesSessionExist() intended to be used? Should I be calling it in every frontend component that needs to know if a session exists? Should I call it and then instead cache the result?
r

rp

04/10/2022, 5:40 PM
hey @User it makes a network call only once when a new visitor visits your site, or if you manually clear all the cookies. You can safely call it each time a component mounts (in
useEffect
and it should be fine)
You do not need to cache anything
k

kelbs

04/11/2022, 12:21 AM
Thanks! So besides the first call is it checking for a cookie or something?
r

rp

04/11/2022, 3:14 AM
Yes. Exactly