Use Local Storage and Manage Session in Blazor

Поділитися
Вставка
  • Опубліковано 10 лют 2025
  • In this tutorial, you will learn how to use local storage and manage session in Blazor Application.
    #localstorage
    #blazor
    #blazorlocalstorage
    #blazorsession

КОМЕНТАРІ • 7

  • @juliancarr5545
    @juliancarr5545 3 роки тому

    Thank you for this!

  • @icedenis9654
    @icedenis9654 3 роки тому

    great video thx a lot :P

  • @stevenkjames
    @stevenkjames 3 роки тому

    Cool

  • @euginesanthanasagayammanue3574
    @euginesanthanasagayammanue3574 3 роки тому +1

    it is working at localhost but after deploy the code into server and not working this variable is null.

  • @pixel7038
    @pixel7038 3 роки тому

    How do you clear local session, code wise, when you end the debugger?

    • @bladeprogramming
      @bladeprogramming  3 роки тому

      You could clear it by using the below:
      HttpContext.Session.Clear()
      Or you can set timeout:
      services.AddSession(options => { options.IdleTimeout = TimeSpan.FromSeconds(10); });
      if IdleTimeout expires, the session expires. If the cookie expires, the session is gone. If the cookie is deleted, the session is gone.
      Calling Session.Clear() removes the contents of the session, but keeps the session intact (session is not deleted)
      More: docs.microsoft.com/en-us/aspnet/core/fundamentals/app-state?highlight=session&view=aspnetcore-5.0

  • @lemonade2345-j4e
    @lemonade2345-j4e 8 місяців тому

    As far as the latest .NET versions are concerned, this "tutorial" is so painfully out of date, it is not even funny. Will not work now, guaranteed. Best to update it or take the video down...