Cookie & Blazor Server-side

Kevin Azure 141 Reputation points

Is Cookie supported by Blazor Server-side?

How to use Cookie to store Login/Session information?

[so the duplicate login prompt won't come for N days]

A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,458 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. S.Sengupta 16,561 Reputation points MVP
    0 comments No comments

  2. Bruce ( 59,306 Reputation points

    Blazor server uses cookie authentication. Just config the identity cookie the way you would for any core website.

    when blazor server needs authentication it redirects to the login, which unloads the app. Then after login redirects back, the app is reloaded. Unless saved, all state values will be lost. You can avoid this by requiring authentication if the hosting page.

    note: typically with blazor WASM you would use bearer tokens.