Is there any dependency between the cookies from Facebook and Access_Token

82 views Asked by At

I have created an app in Facebook and when a user is logged in using my app I am trying to get access_token using FB.getAuthResponse()['accessToken']. When I used Graph API Explorer option in Facebook to debug that access_token it showed that my access_token will be expired in one day. Now I am planning to store cookies from Facebook in order to make the user logged in as long as he needs.

My concern is like if my access_token expires in one day will it affect my cookie stored and ask the user to log in once again ??

If it affects cookies... Can anyone provide a solution ??

1

There are 1 answers

0
Tobi On

There is no direct conjunction with cookies and Access Tokens. The latter are use for leting users give specific permissions on their personal data with Facebook apps.

What you are referring to are so-called short-lived Access Tokens. You can exchange those into long-lived ones, whcih have a maximun validity of 60 days. Even the long-lived one can expire, which can be handled by resending the user to the login flow.

See: