I have created a facebook app, and retrieved the user access_token with a validity of 60 days.
In android there is something as
public void onResume() {
super.onResume();
facebook.extendAccessTokenIfNeeded(this, null); }
This extends the accesstoken , if it is about to expire. Is there any similar alternative in PHP? So that after 60 days the token refreshes, without asking the user to login again to facebook.
This happens while the user is using your app.
No. You have to have the user interact with your app again, so you can get a new short-lived access token – which you then can exchange for a long-lived one.
The whole process is described here: https://developers.facebook.com/roadmap/offline-access-removal/
(And again, for your likely follow-up question, “but I want it to do without user interaction” – that is not possible. If it was, the whole thing about deprecating offline_access would be pretty senseless. Apps are not supposed to go on acting on the user’s behalf “forever” anymore.)