Closed cedricleroy closed 7 years ago
Hi @cedricleroy ,
take a look at this issue: https://github.com/aws/amazon-cognito-identity-js/issues/131
Vladimir Budilov
@vbudilov it has been clear like token get expire in 1 hour from user login. I want to refresh the token after specific interval of time and I am doing that by calling getSession() method but not sure what should be the best interval time to do this? which will reduce my calls to cognito and also token will not get expire.
I have tried 60 minutes of interval but its not working because by the time I refresh the tokens are expired already. Also I have tried 15 minutes of interval and that works well but by this in single hour its refreshing 4 time and somehow I feel these calls can be reduced by increasing this interval time. Can you guide me more about this.
Thanks in advance.
@akashbiz did you find a proper solution?
@Ricardonacif , I have used getSession method as mentioned and after speaking with AWS engineers on chat they suggested to do it in eaither 15 minutes or 29 minutes of interval. There is no other solution is available apart from this. Hope this helps you.
Quick question: Is the session ever expire? I have read that it should happen after one hour, however it looks like session.isValid() is always true. Is there an extra step needed somewhere?