1

I am working with an MVC server with IIS express on port x. I run my client code using express server on port y, and send my requests for data to the server on localhost:x

The issue here is that the SessionId cookie is not sent back to the server on every request due to CORS. I read that the cookie will not be sent to a different domain in case the cookie is not set to SameSite->none but in order to set it to None you also need to set it as Secure as i read from here https://web.dev/samesite-cookies-explained/

Is there an alternative in case I want to work with HTTP and i want the client to send the cookies to the server

omriman12
  • 1,644
  • 7
  • 25
  • 48

1 Answers1

0

Well there are 2 possible solutions for this matter:

  1. You can set the cookie as secure + SameSite->None to make the browser automatically send the cookies for every request
  2. You can tell the browser to send the cookies yourself on each request via: Ajax Fetch API
omriman12
  • 1,644
  • 7
  • 25
  • 48