Open GoogleCodeExporter opened 9 years ago
I also tried to get sessionKey from cookies and create RestClinet using that
sessionKey. But it throws a different exception on users_getLoggedInUser() call
in that case, which says "Session key invalid or no longer valid".
Used following code to get sessionKey from cookie and create
FacebookXmlRestClient using that:
Cookie cookies[] = request.getCookies();
String sessionKey = "";
for(int i=0; i<cookies.length; i++){
Cookie cookie = cookies[i];
if("JSESSIONID".equals(cookie.getName()))
sessionKey = cookie.getValue();
}
userClient = new FacebookXmlRestClient(FB_API_KEY, FB_SECRET_KEY, sessionKey);
Original comment by puri.pra...@gmail.com
on 9 Jan 2011 at 8:23
hi all I need to know how to get user status (ie. is he logged in, or logged
out)?
what calls are needed in my java server to know that?
thanks in advance.
Original comment by bzu.ah...@gmail.com
on 9 Jan 2011 at 8:53
Hello, this is what I have and it seems to work (after applying patch from
issue 342). The patch is only for cookie processing. If you have client side
authentication and you have a cookie with a name that starts with "fb_"+appid.
IFacebookRestClient userClient = new FacebookJsonRestClient(apiKey, apiSecret);
FacebookWebappHelper facebook = new FacebookWebappHelper(req, resp, apiKey, apiSecret, userClient);
//
if (facebook.isLogin()) {
Long fbuid = facebook.getUser();
// Do stuff.
}
Original comment by edru...@gmail.com
on 30 Jun 2011 at 4:33
Original issue reported on code.google.com by
puri.pra...@gmail.com
on 9 Jan 2011 at 6:30Attachments: