I've got a FB app (PHP/codeigniter).. works great.. woo. However, in IE, it refreshes and refreshes over and over. Chrome and the Fox are fine.
I'll include my connection class below, but basically, my FB app points to this, it does it's magic and the user is then passed to another controller for the rest of the session.
Anyone had experience with this before? I am on IE version 8 64 Bit on Win 7, but others have complained on other versions and OS's. I've googled about but seem(?) to be the only man with this prob.. :-(
Anyhoo, here's my controller.
/** * @property Model_user $model_user * @property Model_session $model_session */ class Blue_Connect extends Controller {
function Blue_Connect() { parent::Controller(); $this->load->plugin('facebook'); } function index() { $this->load->model('Model_user', 'model_user'); $this->load->model('Model_session', 'model_session'); $my_url = $this->config->item('facebook_url'); if ($this->session->userdata('user_id') > 0) { echo "<script>window.location.href='/buzz/';</script>"; die(); } else { if(!isset($_REQUEST["code"])) { $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" . $this->config->item('app_id') . "&scope=" . $this->config->item('facebook_perms') . "&redirect_uri=" . urlencode($my_url); echo "<script>top.location.href='" . $dialog_url . "'</script>"; die(); } $token_url = "https://graph.facebook.com/oauth/access_token?client_id=" . $this->config->item('app_id') . "&perms=" . $this->config->item('facebook_perms') . "&redirect_uri=" . urlencode($my_url) . "&client_secret=" . $this->config->item('app_secret') . "&code=" . $_REQUEST["code"]; $access_token = file_get_contents($token_url); $graph_url = "https://graph.facebook.com/me?" . $access_token; $tmp_graph = file_get_contents($graph_url); log_message("error", $tmp_graph); $user = json_decode($tmp_graph); $image = 'http://graph.facebook.com/'.$user->id.'/picture?type=large'; $user_id = $this->model_user->process_user($user->id, $user->name, $user->email, $image); $this->session->set_userdata(array('fb_id' => $user->id, 'user_id' => $user_id, 'access_token' => $access_token)); echo "<script>window.location.href='/blue_connect/';</script>"; die(); } }
}