Ritu Singh
Although it is technically feasible to store tokens in cookies on the Blazor server, it is typically advised against as best practice due to security concerns. However, if you still need to go down this route, here are two ways to achieve it:
One way that the Blazor server app communicates with the client browser is through the use of signalr, also known as webscoke. Since the http request is not contained within the httpcontextaccessor, it will not work if you simply use it to modify the cookies.
You can either use the client js library to set the cookie, or you can use the Javascript interop, but I do not recommend the latter. Another option is to store the token in Blazor local storage.
One alternative is to create a dedicated CookieController and have the Blazor server send requests to it whenever they need to set cookies.
Suggested blogs:
>Step by Step guide to Deploy Terraform in Azure using GitHub Actions
>Testing react components using Hooks and Mocks
>AWS EFS vs EBS vs S3: What are the best AWS storage options
>How to create a GCP Cloud Composer V2 instance via Terraform?
>Why You Should Use Google Cloud Vision API in Android Apps
>How to delete duplicate names from Array in Typescript?
>Create data with Typescript Sequelize model without passing in an id?
>How to Set up the local environment for Angular development?
>How to solve encoding issue when writing to a text file, with Python?