Open Gravgor opened 1 year ago
Having similar issues with similar looking code.
Facing similar issue, did you find the solution ?
I haven't solved it yet. It's part of a side project for me, and I've had other issues to deal with. I might end up implementing sessions differently if I can't figure it out.
maybe check your cookie is setting?
similia issues .
check backend Cors setting
c.Header("Access-Control-Allow-Credentials", "true")
and frontend request like me
` fetch(GET_USERINFO, {
credentials: "include", // <-- append this one
method: "GET",
headers: { "Content-Type": "application/json" },
});
`
I'll try that and update here with what I find.
0
So, i just created a backend setting session and getting session for my app. I would like to access via endpoint getting session i did that, but always session value returning nil even if i had set token inside session via SetSession function on userLogin.
I am using GIN framework + Gin/sessions on backend and Next.js on frontend.
I just tried checking session inside SetSession and there everything working fine, but when request come in from frontend hook, session returning nil which giving me message "Session expired" and error: true.
It should return me token and next check token via function and and the end return for the frontend token to let user enter /dashboard page.
I don't have any more idea why this happen and what can i do with that.
Code: