facebook login to website with only javascript -
is possible?
what i'm doing using this code wherein after line 37 intend setup cookie of own indicating logged in , redirect browser page. think that's not secure since user can javascript , mess cookie. isn't fb js sdk must doing behind scene, setting cookie?
how can securely log in user website(i maintaining db table of fb ids)?
you no need set separate cookie when using fb login authentication , data(fb uid).
but still bit confused u ve do. far understood, if login u want redirect user other page else show him login button
is correct??
then this:
1) have custom login button instead of fbml login button(make invisible first).
2) in setup() method if "response.status" connected redirect else show login button - onclick of button call fb.login() http://developers.facebook.com/docs/reference/javascript/fb.login/ login , authentication of ur site.
3) subscribe "auth.statuschange" instead "auth.login" http://developers.facebook.com/docs/reference/javascript/fb.event.subscribe/ when user status changes, invoke setup() method
this should solve problem.
cheers
Comments
Post a Comment