UserID in Users table

Jul 8, 2012 at 10:03 AM

I'm in process of integrating your forum feature "Login with Facebok" but I don't know where you store the "UserID". I loop through Sessions and Cookies and I don't see it there.  Can you show me how to reference the UserID?

Sorry about too many questions.

Jul 8, 2012 at 10:51 AM
Edited Jul 8, 2012 at 11:23 AM

        NearForums.Web.Controllers.UsersController objUser = new NearForums.Web.Controllers.UsersController();
        int ID = objUser.User.Id;

 

NearForums.Web.State.

UserState objUser= new NearForums.Web.State.UserState

();


 Both of them aren't working and returns error.

 

 

Jul 8, 2012 at 1:07 PM
Edited Jul 8, 2012 at 1:09 PM

Oh well I got around by adding this line

 

 

@{HttpContext.Current.Session["UserID"

] = User.Id;

}

 

 

 

 

in UserMenu.cshtml

 

 HttpContext.Current.Session["ID"

 

Coordinator
Jul 8, 2012 at 1:52 PM

I don't really understand why you have to access the session data (nor for the FB authentication).

For the record, Facebook authentication works out of the box.

 

If you want to access user information on the view, use the properties @User (instance of type UserState)

@User.Id

would render the user identifier.

Jul 8, 2012 at 5:19 PM

I want to integrate the facebook users into my website.  That's why