Talk:Fbml.setRefHandle
From Facebook Developer Wiki
[edit] Questions
Are any hard or soft limits enforced. Specifically, if I set a handle for every one of my app users (because all content is unique and different for each user, because it depends on their friends network) -- will I run afoul of anything? --719255867 15:43, 31 October 2007 (PDT)
[edit] session_key needed?
On the bottom of the page it is stated that a session_key is not needed. This seems to be untrue, since I keep getting "Facebook Error 102: Session key invalid or no longer valid"
I've got the same issue, and read this posting in Google code, hope this could help!
Reported by niftykit, Nov 29, 2007
What steps will reproduce the problem? 1. Create an application running in the facebook iframe or on an external site, using the setting FACEBOOK_INTERNAL=False. 2. Using the application, login to facebook without the "Save my login info" option. 3. Wait for the facebook session to expire 4. Access any page on the application that uses the facebook api
What is the expected output? What do you see instead?
Traceback (most recent call last): File "/home/niftykit/lib/python2.5/django/core/handlers/base.py" in get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "/home/niftykit/python_inc/facebook/djangofb/__init__.py" in newview
93. return view(request, *args, **kwargs)
File "/home/niftykit/webapps/django/niftykit/niftymap/views.py" in get_update
92. friend_ids = request.facebook.friends.get()
File "/home/niftykit/python_inc/facebook/__init__.py" in get
428. return super(FriendsProxy, self).get()
File "/home/niftykit/python_inc/facebook/__init__.py" in __call__
335. return self._client('%s.%s' % (self._name, method), args)
File "/home/niftykit/python_inc/facebook/__init__.py" in __call__
735. return self._parse_response(response, method)
File "/home/niftykit/python_inc/facebook/__init__.py" in _parse_response
710. self._check_error(result)
File "/home/niftykit/python_inc/facebook/__init__.py" in _check_error
665. raise FacebookError(response['error_code'], response['error_msg'],
response['request_args'])
FacebookError at /map/update/ Error 102: Session key invalid or no longer valid
What version of the product are you using? On what operating system?
SVN revision 110 on linux.
Please provide any additional information below.
I suspect that the session key is being stored in the django session. Looking at Facebook.check_session():
if self.session_key and (self.uid or self.page_id):
return True
I suspect that those variables are being stored in the session and not being validated, so check_session() returns True, and the error only shows up once a facebook api call is attempted. If that's the case, I can see three possible solutions:
1. Make check_session() call something like auth.getSession() every time, which should result in failure and redirection to the login page. However, that seems really inefficient. 2. Catch the exception for any api call and redirect to the login page. That seems a bit ugly though. 3. Catch the exception outside pyfacebook and handle it there.
Have I got the right idea of what's going on? What would be the best way to handle it?
Thanks! Rohan
