I have this website that uses react, django
Its an ecommerce so once they want to pay for the product all off the cookies being deleted
what happens behind the scenes is once they place an order it will generate an transactionId
when user click the Pay now button to pay the order they will go to another website to place their credit card and pay
then that transactionId will be stored in the cookies to verify, see if the order is payed or not
if it is payed then it will make the order as a payed order for the user
The problem is once they go for placing their credit card on another website all of the cookies of my website being cleared
what is the problem
Here is a example of my cookie
setCookie("transId", `${orderId}`, {
path: "/",
expires: new Date(new Date().valueOf() + 1000 * 60 * 60 * 1000),
sameSite: "lax",
secure: true,
});
this setCookie is coming from react-cookie package
can you see where is my problem ?
is it because cookie is not httpOnly or something else is the problem
I realy need your help :))
thanks
you have to provide the domain also in my case
const SITE_ROUTE = process.env.SITE || 'localhost';
res.cookie('authentication', token, {
maxAge: 900 * 900000,
httpOnly: false,
domain: SITE_ROUTE,
});
Site in env is admin.goq.com