Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Using a Cookie in a Model

$
0
0

I would like to make a function in a model to access a cookie.  The reason I want to do this, is so I can easily call this function from throughout the site to get this piece of information (such as a UserID).  However, I've found that I can only access cookies via the Controller.  Do I need to make this function in a controller and reference the controller all the time, or am I doing something completely wrong.  I have a feeling the second answer is probably right :)

Thanks for any help!


Viewing all articles
Browse latest Browse all 9386

Trending Articles