Welcome Guest, Not a member yet? Register   Sign In
Logout from facebook php sdk with codeigniter
#1

[eluser]mojitoo[/eluser]
Hey!

I have problem with my logout button for facebook with their php sdk package. I've created a link in my view that redirects to a controller called logout

controller
Code:
function logout()
{
  $this->session->sess_destroy();
  $this->Facebook_model->destroy_fb_session();
  $logout_url = $this->Facebook_model->get_logout_url();
  echo $logout_url;
  redirect($logout_url);
        }

model
Code:
function destroy_fb_session() {

  $this->facebook->destroySession();
}

but when I press the link will I receive the following message: Message: Cannot modify header information - headers already sent by

It works just fine to log out if I'm using the logout url without going through a controller and a model like this http://www.dannyherran.com/2011/02/faceb...ntication/ but the reason I want to go though a controller is to be able to kill some of my own sessions and maybe something more.

I would appreciate if anyone would be able to help me to get this logout button to work.
#2

[eluser]Stavros[/eluser]
try to remove that echo $logout_url;




Theme © iAndrew 2016 - Forum software by © MyBB