SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Facebook Connect problem

    I am using some code to check if the user is logged in with facebook, but something strange happens, sometimes the code recognized the FB cookie and sometime it doesnt (i.e. if I refresh the page sometimes the cookie is recognized and then sometimes it asks me to login again - however cookie exists all times)

    MY CODE:

    Code:
     if(!isset($_COOKIE['fbsr_530028260370435'])) 
    		 {
    		 echo '<div style="padding-top:17px;"><div class="fb-login-button" style="float:left;" onlogin="javascript:CallAfterLogin();" size="medium" scope="publish_stream,email">Connect With Facebook</div><div class="clear"></div></div>';
    		 }else { echo '<div class="upload_t"><a href="'.base_url().'index.php/main/myaccount" id="inline" class="btn btn btn-info">my uploads</a></div>';}?>

    I also checked in Firebug and keep getting this error:

    FB.login() called when user is already connected.
    Is there a known solution for checking the FB cookie server side?? Am I checking the correct cookie?

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2011
    Location
    Kolding, Denmark
    Posts
    108
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Try using Facebook PHP SDK, it will make things easier.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •