How exactly does the doesSessionExist work?
# support-questions-legacy
a
How exactly does the doesSessionExist work?
r
hey @abhisheksinghkapoor
it reads tokens from the frontend to see if a session exists or not
a
I am trying to hit an api with, it contains the cookies but when I check for the doesSessionExist it returns as false
r
doesSessionExist is a frontend function
are you calling it on the backend?
a
No I am calling it on the frontend
r
what is the state of the frontend cookie store? Can you send a screenshot?
a
r
not response cookies
but cookies stored on the frontend
application > cookies
a
Wait
r
have you called supertokens.init on the frontend?
before making the API call
a
Yes I did
I am using it as a plugin
r
can you enable frontend debug logs and show me the output of the API call?
see the troubleshooting section in the docs
a
ok
Not sure if I am able to find it
r
which recipe are you using?
a
got it
r
ok
a
The session logs aren't being consoled
r
right. This means you have not called supertokens.init of the fronternd SDK
can you do a console log right before the supertokens.init on the frontend and see if that gets printed out before the API call is made?
a
SuperTokensRequest.init({ refreshTokenUrl:
${baseURL}/session/refresh
, sessionExpiredStatusCode: 440, enableDebugLogs: true, });
r
which version of the SDK are you using?
This is very old it seems
a
4.4.1
r
and which SDK?
a
supertokens-website
r
did u add axios interceptor when making the API call?
a
I am not sure about usecase of axios interceptor
r
are you using axios?
a
yes
SuperTokensRequest.makeSuper($axios);
r
yea thats what i meant
make sure that that is added before making the API call
a
yea so basically this is all being used as a plugin itself
so they are being called when the page loads
r
hmm
a
Making a check if it is failing by any chance
r
are you sure that the API being called is = to the value of
baseURL
that's set in the init function call?
cause i think the issue earlier as well was that there was some mismatch with this that was causing an issue
a
means the endpoint of api and the baseUrl api
r
yes
a
Ok I will debug for that
15 Views