I'm trying to get a user ID stored in cookies via a common Controller file, which I can access throughout the site.
I have created FunctionsController
as a controller, with content as follows:
public static int loggedinUser()
{
return Convert.ToInt32( request.Cookies["userid"].Value);
}
I am unable to request any cookie items even if I tried with:
HttpRequestBase request = controllerContext.HttpContext.Request;