views:

103

answers:

6

I need to know if the users of my website has logged to facebook in the past 30 days.

Can I know this through facebook cookies or in another way ?

A: 

You cannot read cookies from "other" sites. Actually you cannot read any cookies at all. The client/browser is sending you the cookies with their values. And they have no reason to send cookies to a web server which are associated to a total different site. If you want to know if a user have login into facebook you have to asked the facebook servers (if they have such an API and if you know the username)

Progman
A: 

No - even if you knew their Facebook ID, had their email address, the user granted you every single extended permission, and also knew the user's favorite color and the names of all their pets, you still would not be able to determine what you're asking for.

Peter Bailey
+2  A: 

You will not be able to check whether the user has logged into Facebook any time. What you can do is leverage the CSS history hack to see whether the user has visited Facebook.

But that would still be kind of unethical...

moontear
It also wouldn't necessarily indicate that they visited in the past 30 days, and it doesn't mean they've logged in either.
manyxcxi
+6  A: 

Create a <form> that asks

  1. "Do you have a facebook account?"
  2. "If yes, have you logged into it in the last 30 days?"
brian_d
+2  A: 

You could try checking the Facebook Developer Tools for website integration.

manyxcxi
+1  A: 

Answering your title question - actually it is possible to know if a user has facebook account, but only if he/she is logged in into facebook right now (even for those that never authorized your app before). You can do this by calling FB.getLoginStatus() and checking returned status. If it equals to notConnected - user is logged in into facebook right now.

serg
and if he/she is not logged in to facebook what it return ?
xRobot
@xRobot it will return `unknown`
serg