Base solution for your next web application
Open Closed

Additional properties for AbpSession #41


User avatar
0
mohamed emaish created

what is the best way to add additional properties to session, for instance (EmployeeId)


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    I think userId is enough. You can get current user and then get it's EmployeeId in an app service method. If you really need it, you can define a custom claim.

    NOTE: AbpSession if different than ASP.NET's session. ASP.NET's session is stored in the server's memory, while ABP Session variables intented to be stored in cookies of the client. This is suggested for Web API (As you know there is no session in web api as default. Because web API should be stateless).

    Link for others: <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero/issues/63">https://github.com/aspnetboilerplate/mo ... /issues/63</a>