In ASP.NET Core, what the best option to store the value after login successful?

Jerry Lipan 916 Reputation points
2022-02-07T14:17:02.257+00:00

Hi,

In ASP.NET Core, what the best option to store the value after login successful?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,234 questions
{count} votes

Accepted answer
  1. AgaveJoe 26,161 Reputation points
    2022-02-08T12:09:32.35+00:00

    In ASP.NET Core, what the best option to store the value after login successful?

    The best option is following openly published standards. Ether implement identity or configure the authentication cookie middleware in the MVC Core project.

    Introduction to Identity on ASP.NET Core
    Use cookie authentication without ASP.NET Core Identity

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Michael Taylor 49,166 Reputation points
    2022-02-07T15:52:21.727+00:00

    What value? Please provide more information.

    If the data is associated with the login in user account then add it as a claim on the user's token.
    If it is cached data about the user then consider storing it either in a cookie (if you want cookies and it is not sensitive) or perhaps in memory using MemoryCache or out of process using a database.

    0 comments No comments

  2. Jerry Lipan 916 Reputation points
    2022-02-08T03:18:15.253+00:00

    Hi @Michael Taylor ,

    I want to store Token value. Store this token until user logout