agorapulse / grails-facebook-sdk

Facebook SDK Grails Plugin
http://agorapulse.github.com/grails-facebook-sdk/guide
30 stars 13 forks source link

No Facebook Cookies when using getLoginURL #55

Closed confile closed 11 years ago

confile commented 11 years ago

It turns out that facebook cookies fbm and fbsr are perfectly set if I use this:

<facebook:loginLink appPermissions="${facebookContext.app.permissions}">Login</facebook:loginLink>

When I generate a login URL with:

def auth() {
def loginUrl = facebookContext.getLoginURL(
                redirect_uri:createLink(controller:"facebookLogin",action:"successAction",absolute: true),
                scope: grailsApplication.config.grails.plugin.facebooksdk.appPermissions)

            redirect uri: loginUrl
}

I can still login, but I get no Facebook cookies set.

What is the difference? Both variants should lead to the same result.

benorama commented 11 years ago

fbsr cookie is set by the Facebook Javascript SDK. When you use a server side redirect, there is no cookie created, facebook info are passed through the app via signed_request params and stored in session scope. It is the same behaviour when you are running your apps on apps.facebook.com.