'Cookies NodeJS not getting saved

Unable to set default cookies in nodejs working fine in contact

can anyone see what I am doing wrong the call from front end is handled

let handleSignInS

    ubmit = async (e) => {
            e.preventDefault();
            const { email, password } = userSignIn;
            const res = await fetch(baseURL + signInendpoint, {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify({
                    email,
                    password,
                }),
            });
    
            const data = await res.json();
    
            if (res.status === 400 || !data) {
                window.alert("Something went Wrong in SignIn");
            } else if (res.status === 500 || !data) {
                window.alert("Login 500 Successfull");
            } else {
                window.alert("Login Successfull");
                navigate("/");
            }
        };


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source