<p>I'm having trouble figuring out how to access a cookie from a compiled object. I'm trying to make a compiled (DLL) object that will check the users cookie and then compare that to a database to confirm they have the correct access. </p>

<p>I can pass in the cookie info fine and the component will work, but I'm trying to have the component check the users cookie as well. I'm not even sure what object to use. I've been searching all weekend and I've seen references to httprequest, httpcookie, cookie, and cookiecollection. </p>

<p>I can look up cookie values on the page itself using Request.Cookies("inet")("user_id") but this doesn't work in the component. </p>

Objects (App_Code/ compiled dlls) can only access Request via the static HttpContext.Current object
```
```
HttpCookie cookie = HttpContext.Current.Request.Cookies["CookieName"];
```
```
(If it's not called from a web app, HttpContext.Current is null, so you may want to check for that when running in unit testing)
(If this isn't App_Code, you'll need to reference System.Web)