I have a .Net Core Backend running and its access point for request is http://localhost:5108/graphql/
If I execute a request from this endpoint I get back the cookie and my Browser saves it.
If I execute this from my fronted which runs on a different Port my cookie won't get saved. My Backend and my frontend uses currently http and not https
Here you can see that it does not get saved:
My cookie has the following parameters that are set in my backend:
httpOnly: true
path: "/"
samesite: "None"
secure: true
How can the frontend browser save the cookie now?
I solved it.
I had to add withCredentials: true
export function apolloOptionsFactory(): ApolloClientOptions<any> {
const httpLink = inject(HttpLink);
return {
// link: httpLink.create({ uri }),
link: httpLink.create({ uri, withCredentials: true }),
cache: new InMemoryCache(),
};
}