Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How does the latest Blazor Web App (ssr) handle cookies that are received from Backend Server?

$
0
0

I'm trying to find out how the Blazor Web App with .NET 8.0 handles set-cookies that we get from a backend api server. I know that if we are using Blazor WASM, cookies received from backend are automatically handled by the browser, and if you are on different domain which in this case frontend and backend are different domain, we can use Reverse proxy to transform the headers before sending it to the client.

But even after using reverse proxy and putting both the backend and frontend on the same domain, just different path, the cookies received from backend are not stored on the client browser automatically. Plus, I couldn't find a tag for Blazor Web App on Stack Overflow.

I looked and searched quite a lot and I tried quite a lot of methods. This includes setting:

Access-Control-Allow-Origin: https://localhost:mylocalhostAccess-Control-Allow-Credentials: true

on the backend did not solve the issue. I am working on the frontend part. I created a login page and send the username, password along with other needed variables using api to the backend for authentication, and after successful authentication the backend will send me a success code along with a Set-Cookie variable. Here is where i stuck, Again, I tried reverse proxy, cors, same domain, change the origin from '*' to my localhost on the backend and still the cookies are still not appearing on the application tab of the developer tools. Which makes me wonder if this is possible at all or Blazor Web App have a different method to handling cookies from backend?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>