Thansk hh3, your solution really worked.
There are issues with fb connect whether you use php or js sdk. I am using js and php sdk in 1 of my site and there was an issue with cookies not clearing so i had to manually clear by keeping a check whether user has logged out of fb or not. Even if i used the logout from js or php it didn’t worked.