Magna Boss
Magna Boss

Reputation: 289

ASP.NET - The name 'Context' does not exist in the current context

I am getting the error in the title above from this line of code:

HttpCookie authCookie = Context.Request.Cookies[cookieName];

Is there something I forgot to use ?

    

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using System.Security.Principal;

Upvotes: 6

Views: 9939

Answers (1)

David L
David L

Reputation: 33815

If you are in the context of a controller, you should be using HttpContext.

HttpCookie authCookie = HttpContext.Request.Cookies[cookieName];

Upvotes: 4

Related Questions