Getting Session in facebook - facebook

Can we get session key in Facebook in below mentioned scenario? Through my app, I called facebook login, dialog appeared:
I logged in Facebook then second dialog for permissions appear
I denied permissions for accessing some user information by pressing deny.I called Fb.logout but it gives me error "logout called without session", but if open a new tab and type www.facebook.com it shows me logged in.
So, I was wondering that session has to exist but I do not know how to get that?
can somebody please help or guide or correct me, if wrong.
Thanks and Regards,
Prashant Verma

NOTE: You can only log out a user that is connected to your site.
refer: http://developers.facebook.com/docs/reference/javascript/fb.logout/
The user does get logged-in to Facebook but not authorized your application. Your app does not hold the session, and it can't log-out the user.

Related

Facebook outh dialog prompt for log in vs using logged in user?

Does anyone know of a way to redirect to Facebook's oauth dialog and have it prompt for a log in. It currently uses the logged in Facebook user. This is sometimes confusing to user since they may want to authorize a different account. Thanks!
You can use re-authentication, but use it only when absolutely needed.

PHP Facebook SDK persistent logged user

I am having a situation here. You can check my installation at: http://rs.eboxtools.com
The problem is that when I logged once I can't make a true logout. Even when I logout from Facebook I can still see my user info as if I was sign in.
Why is Facebook keep showing the same info?
In my opinion if an user choose to logout the app shouldn't accept the same user and should ask Facebook to log in a user and show only the information if user is logged in. Am I missing the point?
My direct question is. How can I definitely log out from facebook in this situation. I saw many sites like PHP Classes that just let the last user that used Login With Facebook to log in without being logged in at Facebook. This is a security problem right? That means that If I use Log in with Facebook once, even if I logout facebook and the app in question the next person that uses the same option will be logged in at my own account!!
Thanks for any help clarifying this... :)
In your case - you have to remove the PHPSESSID cookie:
setcookie("PHPSESSID","",time()-3600,"/");

FaceBook Login with Other Username

I have a problem with Facebook login. I create app on my Facebook id, and from my app i am able to login and get user Inforamtion. it works properly with my Facebook username. But when I am Login with other user name in Facebook and get data it not working. Why it's work for me.but not other user.
it shows the following error.
if i login with my Id then it works properly.
please help me. what is the problem?
Set sandbox mode to no in your application settings in facebook.
Check in your app settings -> sandbox mode
Problem might be that new user havent given permissions to your application to get data.
Verify that when a new user log in. Ask for basic permission then attempt to get data.

How to hide the facebook authorization dialog on iPhone?

I'm implementing facebook connect for my iPhone app. The current facebook SDK would keep you logged in unless you log out explicitly, which is fine with me as stay logged in is actually the requirement. However, I don't want the users to go press the log in button if they never logged out. In this case, I won't be able to grab the facebook object, which I'll need in other parts of my app. So I was planning to simulate the log in event anyways, but that led me to another problem: even though permissions are granted to my facebook app before, it will still pop up the authorization dialog to my users saying they have granted permissions to my app. My question is, how do I hide this? Or, is there a way that I can grab the valid facebook object without calling authorize on my facebook object when my app is restarted and the user stayed logged in?
Any suggestion would be appreciated.
You could redirect the user to https://www.facebook.com/login.php?api_key=<YOUR_APP_ID>. (This is the URL that the PHP Facebook SDK returns when you call getLoginUrl()).This will avoid the dialog and still allow users to authorize your app.

Help regarding Facebook Connect...!

I have completed the facebook connect process. I need to address the following issues....
If a user has authorised my application: then on pressing F5, he must automatically be signed in...
If the user logs out of my site, he must log out of faceboook as well, and then display a dialog message.
Please help
You could try to redirect the user to Facebook's logout page. I doubt it works but it might be the only possibility.
Why do you want to log the user out of Facebook anyway? As a user I'd be pretty pissed about that, but then again I don't know what kind of app this is so it might make sense in some custom Facebook interface or something.
You could do something like
logout
However, it's rather user-hostile: unless I (the user) have asked you to do that, why the **** are you logging me out of Facebook?