I am trying to set a session inside a abstract class which is already written. What I am trying to do is;
First I try to check the method type either is get or post. If it is GET method then set the session.

here is the code:

```
public abstract class BaseAbstractController : Controller
{
    public BaseAbstractController()
    {
        if (this.HttpContext.Request.HttpMethod.ToString() == "GET")
        {
            this.HttpContext.Session["testsession"] = this.HttpContext.Request.Url.AbsolutePath;
        }
    }
}

```

The problem I am facing is, I get the Null exception error and it is because HTTPContext value is null.

Right now there is only one MVC controller that extends from abstract controller.