My scenario is as follows:
The user will log into the system. Then it will display a list of items and it will pick one.
I then need the system to store the logged-in user and the item he chose.
I do not know how I can be doing this and I do not know what technologies I can use.
Currently, for authentication of my projects, I use FormsAuthentication , but the same I can not store more than one value (at least I do not know).
I found the following alternative:
Forms.SetAuthCookie (UserName + "|" + UserId, true);
if (HttpContext.Current.Request.IsAuthenticated)
{
userId = Convert.ToInt32(HttpContext.Current.User.Identity.Name.Split('|')[1]);
}
I also thought about using Session
, but I think there is a more appropriate technology.