session validation works on dev but not on prod

right now, on dev everything works fine. if i log in, i get a session and the getSessionData function returns a session. after pressing the login button i get redirected to /home. but on production, even after pressing login i remain at the /login page. when i check the network tab, it directs to /home and back to /login.

in my /home page, i check for session, and if i dont have a session then i redirect to the /login page.
const session = await getSessionData()
console.log("Dashboard Layout Session:", session); // Log the session
if (!session) {
console.log("Session is null, redirecting to /login"); // Log before redirect
redirect('/login')
}

i believe the issue is in getSessionData because if i remove the redirect part, i don't get redirected. but i can't see any reason why this wouldn't work as:
#1: it works on dev
#2: it just does this:
https://www.codebin.cc/code/cm5gj11aq0001js03jcmievkt:AvS7VoZgqj9iz2B17o6iRDei3wmDkhf9YU68yM82DGgM

i checked my logs for getSessionData and it shows my database results correctly
Codebin Paste:
Description: asdf
Language: javascript
Last Edited: 1/3/2025, 9:02:21 AM

Expires: never
Was this page helpful?