HttpSession session = request.getSession();
String sessionKey = (String) session.getAttribute("facebookSession");
String token = request.getParameter("auth_token");
if (sessionKey != null && sessionKey.length() > 0) {
facebookRestClient = new FacebookXmlRestClient(apiKey, secretKey, sessionKey);
}
else if (token != null) {
facebookRestClient = new FacebookXmlRestClient(apiKey, secretKey);
session.setAttribute("facebookSession", sessionKey);
try {
sessionKey = facebookRestClient.auth_getSession(token);
session.setAttribute("facebookSession", sessionKey);
} catch (FacebookException e) {
e.printStackTrace();
}
} else {
+ apiKey + "&v=1.0");
return;
}
response.getWriter().println("Hello World");
Where I think I wasn't quite is I think that the jsp code above (i.e. my code) DOES originally create the session ID. However, it uses an HttpSession object to pass it to facebook. So, the question remains basically, how can webobjects mimic the functionality of an HttpSession object? Below I've pasted the key line of code that I'm unsure of how to do using webobjects:
session.setAttribute("facebookSession", sessionKey);
Or perhaps facebook doesn't really care? It's my session ID after all, but then again, maybe it's I that will need the session ID back from facebook. My brain is starting to hurt.
Thanks,
Jeff