Might be better to rewrite the login mechanism to use server side flow now that Facebook provides it.