T
TanStack12mo ago
conservation-jade

HTTP Session Cookie

Hello, I'm new here around tanstack but have been using query and table for a couple months, I ran into an issue today with an assignment using router where my Auth API uses session cookie stores to store a user's session for Auth purposes, and it was not saving it for some reason? And I then went over to nextjs and it worked without any issues, is there something theory wise that I am doing incorrectly Usage would like similar to below:
const loginResponse = await fetch(
apiUrl + "/authentication/login",
{
method: "POST",
}
);

const loginStatus = loginResponse.status
const loginResponse = await fetch(
apiUrl + "/authentication/login",
{
method: "POST",
}
);

const loginStatus = loginResponse.status
And from here the server should have already saved the cookie session?
6 Replies
fair-rose
fair-rose12mo ago
this needs much more detail. are you using tanstack start?
conservation-jade
conservation-jadeOP12mo ago
No I am using existing project method, uhm I dont know how much more detail Im able to give other than using hono for the backend with hno-sessions to set a session and its sessionMiddleware function
fair-rose
fair-rose12mo ago
ok was just wondering is the cookie being returned for this particular call?
fair-rose
fair-rose12mo ago
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.
From An unknown user
From An unknown user
fair-rose
fair-rose12mo ago
can you reproduce this in a complete minimal example?
conservation-jade
conservation-jadeOP12mo ago
Ill have a look, I am attempting to see if maybe I just need to do my vite config over I got it working thank you.

Did you find this page helpful?