I am working on an iPhone app,in this i have an option for sharing my posts with face book(i am just passing the user id of facebook user and my server side developer do the pos
Since you're using the 3.1 version of Facebook SDK, openActiveSessionWithPermissions:allowLoginUI:completionHandler:
is not supposed to be used and the old way of doing it does not seem to be functional anymore; from the 3.1 migration documentation;
...you will need to remove usage of openActiveSessionWithPermissions:allowLoginUI:completionHandler: and replace it with openActiveSessionWithReadPermissions:allowLoginUI:completionHandler: (or even more simply, openActiveSessionWithAllowLoginUI).
Later, when your app needs to publish back to Facebook, you should use reauthorizeWithPublishPermissions:defaultAudience:completionHandler: to seek the additional permissions.
Even more details available at the migration docs.