Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook Integration Session Issue
    text
    copied!<p>Here is my UserLogin.aspx Page code, which contains authentication of Facebook user, the problem is i am maintaing token in session which i laterly use it on Default.aspx. if you see the line Session["facebook_token"] = authToken;</p> <p>On my Default.aspx page load i have placed this code, but it gives me null value, when i go to home or default page.</p> <pre><code> if (Session["facebook_token"] != null) lblUserName.Text = Session["facebook_token"].ToString(); using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using SocialMediaModel; using Facebook.Components; public partial class UserLogin : System.Web.UI.Page { FacebookService _fbService = new FacebookService(); private const string FACEBOOK_API_KEY = "551810942508804"; private const string FACEBOOK_SECRET = "b63b8cca428b42935e6eab59976367b1"; protected void Page_Load(object sender, EventArgs e) { // ApplicationKey and Secret are acquired when you sign up for _fbService.ApplicationKey = FACEBOOK_API_KEY; _fbService.Secret = FACEBOOK_SECRET; _fbService.IsDesktopApplication = false; string sessionKey = Session["facebook_session_key"] as String; string userId = Session["facebook_userId"] as String; string authToken = Request.QueryString["auth_token"]; Session["facebook_token"] = authToken; // We have already established a session on behalf of this user if (!String.IsNullOrEmpty(sessionKey)) { _fbService.SessionKey = sessionKey; _fbService.UserId = userId; } // This will be executed when facebook login redirects to our page else if (!String.IsNullOrEmpty(authToken)) { _fbService.CreateSession(authToken); Session["facebook_session_key"] = _fbService.SessionKey; Session["facebook_userId"] = _fbService.UserId; Session["facebook_session_expires"] = _fbService.SessionExpires; } // Need to login else { Response.Redirect(@"http://www.facebook.com/login.php?api_key=" + _fbService.ApplicationKey + @"&amp;v=1.0"); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload