cookies
hi all
I use useTable useForm and another hooks to get the data from the backend
in the backend (nodejs, mongo) I created a session to save the login status
I found that every time I move from page to another I get a new session in my DB
I think its maybe because everytime I get a new cookie ID from the front end
anyone know if there is another reason or can explain the cookies in refine ?
thank you
7 Replies
Hey @Deleted User! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet about cookies and sessions in refine. However, you can refer to the refine documentation for more information on hooks and other features: https://refine.dev/docs
----------------------
Overview | refine
What is refine?
<@1073419683014922323> kapa.ai is still learning and improving, please let us how it did by reacting below
exotic-emerald•2y ago
cookies in refine not different from any react/javascript application.
example of cookie usage
https://github.com/refinedev/refine/blob/next/examples/with-remix-headless/app/authProvider.ts#L24
this is remix example but not different from nextjs or cra appliation. thats the beautify of refine's authProvider abstraction.
explanation:
1. on
authProvider.login
sets cookie
2. on authProvider.check
checks user has cookie, if not redirecting to login page.
3. on authProvider.onError
if API returns 401, redirecting to login page
are you using refine@3 or refine@4 ?
3 or 4 logics are the same but returning values are changed with refine@4stormy-goldOP•2y ago
I think 4
exotic-emerald•2y ago
okay. this example uses 4 too
stormy-goldOP•2y ago
I think the problem from server side
I will take a look for both
thanks
is anyone know in mern stack and check if the issue from the backend ?