Finally, I have fixed the issue.
Yes, FosFacebookBundle will create user session for application.
We no need to write authentication provider.(But we should have Facebook Provider to authenticate on it. like given in FosFacebookBundle basic usage document).
my security.yml firewall config:
firewalls:
main:
pattern: ^/
anonymous: true
form_login:
login_path: /
check_path: _security_check
failure_path: login_failure
success_handler: Projectfolder.authentication.success_handler
fos_facebook:
login_path: /
check_path: _security_check_facebook
provider: fos_facebook_provider
default_target_path: /
logout:
path: /logout
target: /
My routing.yml :
_security_check_facebook:
pattern: /facebook/login_check
defaults: { _controller: ProjectfolderUserBundle:Security:loginFb }
_security_facebook_logout:
pattern: /facebook/logout
Note:
_security_facebook_logout, we won't use in our application. While logout we will remove only application user session not facebook session. We can use this url during development.
I have called login_check instead of /facebook/login_check. So User session is not set in my application. Now it's working fine.