Store UserID in session?

前端 未结 2 1496
长情又很酷
长情又很酷 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: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.

提交回复
热议问题