Laziale
Laziale

Reputation: 8225

Object reference not set to an instance of an object. httphandler session

I am receiving "Object reference not set to an instance of an object." when I am trying to add access token from fb to the httpcurrent.session object.

I have the value in the var accessToken and when I am trying to put it in the session I am getting the error.

Please refer to the image:

enter image description here

Upvotes: 3

Views: 1948

Answers (1)

Rupo
Rupo

Reputation: 402

You need to enable session state in an HttpHandler, so you have to implement

System.Web.SessionState.IRequiresSessionState

Change to the following:

public class FacebookLogin : IHttpHandler, System.Web.SessionState.IRequiresSessionState

Upvotes: 5

Related Questions