IsConnected is always false for my app

Jul 13, 2010 at 12:06 AM
Edited Jul 13, 2010 at 12:09 AM

Here's the issue I'm facing.

When I run Connect example included in the download, everything runs nice and well. I can log in and out and ConnectSession's IsConnected() returns "true" when I'm logged in and "false" when not.


However, when I add facebook.dll to my own sample web app and use my FB Test App's appKey and appSecret, IsConnected() is ALWAYS false, even when I'm logged in.

FB Test App settings:

- NOT in test mode

- Connect url is set to "http://localhost:5000/" which is my local dev environment

- All other fields in Connect tab are left blank (and the rest are default)


Web page code:


<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
        <div id="fb-root"></div>
        <fb:login-button size="small" autologoutlink="true"></fb:login-button>            
        <script src="" type="text/javascript"></script>
        <script type="text/javascript">
          FB.init({appId: '<%=appID %>', status: true, cookie: true, xfbml: true});
          FB.Event.subscribe('auth.sessionChange', function(response) {
            if (response.session) {
              // A user has logged in, and a new cookie has been saved
            } else {
              // The user has logged out, and the cookie has been cleared


Code behind:


using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page 
    protected string appKey = "XXX";
    protected string appSecret = "XXX";
    protected string appID = "XXX";

    protected void Page_Load(object sender, EventArgs e)
        Facebook.Session.ConnectSession conSes = new Facebook.Session.ConnectSession(appKey, appSecret);

        if (conSes.IsConnected())


Are there any parameters that I'm missing? Perhaps some settings in the FB test app? Thanks!

Jul 14, 2010 at 10:42 PM
Edited Jul 15, 2010 at 5:39 AM
I think you have to include: script type="text/javascript" src=""></script instead of all.js, and call init like: FB.init("appid", "xd_receiver.htm"); all.js sets different cookies which aren't compatible with the toolkit.. Hope this helps!
Jul 15, 2010 at 5:14 AM
yes... something like this..

<script type="text/javascript">FB.init("[AppKey]","../xd_receiver.htm", { "reloadIfSessionStateChanged": true });</script>

On Thu, Jul 15, 2010 at 3:12 AM, Hiawatha <> wrote:

From: Hiawatha

I think you have to include: instead of all.js, and call init like: FB.init("appid", "xd_receiver.htm"); all.js sets different cookies which aren't compatible with the toolkit.. Hope this helps!

Read the full discussion online.

To add a post to this discussion, reply to this email (

To start a new discussion for this project, email

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at

Gopi Krishna. L

"I hate quotations. Tell me what you know."
                                   -Ralph Waldo Emerson