Store UserID in session?

前端 未结 2 1467
长情又很酷
长情又很酷 2021-01-19 23:26

To present user specific data, where do I store the userID of the user currently logged in? the Session?

相关标签:
2条回答
  • 2021-01-20 00:04

    yes. sesssion is used for storing user specific data.

    0 讨论(0)
  • 2021-01-20 00:14

    Yes, the session would be an appropriate place for that information. Assuming you are using the authentication features baked into the ASP.NET framework, you will either be loading the user ID from HttpContext.Current.User.Identity.Name or looking it up from that value.

    0 讨论(0)
提交回复
热议问题