Search code examples
asp.net-mvcasp.net-identityclaims

Storing user language as Claims


In an ASP.NET MVC app I'm developing I thought I could store the user language as a Claim so I don't have to access the database or deal with session. Is there any drawback to this?


Solution

  • If user language can not be changed by user through the application, I don't see any major drawbacks here. As an opposite if user can modify it's language in your application you will have to refresh your authentication token - and this is something you should consider.

    Another drawback is, the more claims you add to the token, the bigger it be but in this case it is really negligible.

    By the way, why are you against sessions(i think using it here isn't that bad...)?