Update Header Redirect to Javascript Redirect for Facebook Login

the header redirect do not work under iframe, as a result login redirect will not work for the app on facebook.com. I updated the redirect from header to javascript in order to support app on facebook.com