I'm building a website that will authenticate users via Facebook connect and I'm torn between using the PHP SDK/Server-side flow or the JS SDK/Client-side flow.
Here are some considerations:
There are prob a few more I can think of. But based on these requirements I'm guessing I'm going to need to use both SDKs. But which SDK should I rely on for the initial application authorization/new user recording in my database?
My idea of how this might work in both scenarios:
JS SDK:
User selects login button, callback method fires AJAX request to server and passes along the authenticated user's FBID via post. Code on server determines if this is a new user, and records in database if no existing record is found + records access_token to allow server-side API requests.
PHP SDK:
User is redirected to Facebook's authorize page and script that is executed after Facebook redirects a user back to my app records a new record if no existing record for that user is found. But will the JS SDK be able to execute calls to the API if I've authenticated using the server-side flow?
You've already got a strong analysis of the differences between the languages. Beyond that its really a preference and its true there is nothing holding you from using both.
To answer your question though it would, in my opinion, best to use javascript:
If you only want to use one, then your number 3 pretty much requires the PHP SDK. Beyond that, it really is personal preference.