mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-27 16:05:51 +03:00
[GH-ISSUE #51] Access token is always expired #28
Labels
No labels
bug
docs
enhancement
enhancement
enhancement
feedback wanted
good first issue
help wanted
help wanted
help wanted
invalid
pull-request
question
question
upstream
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-web-api-php#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kobelobster on GitHub (Aug 21, 2016).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/51
Hey,
using your api to retrieve user's playlists and do some more stuff. When I call a method to the API I call my own method
refreshTokens. This method checks if the token expiraton is less than 60 seconds and then updates the refresh tokens. However, I'm always running into the case true for$this->session->getTokenExpiration() - time()and I don't know why. It seems like the access token gets refreshed but as soon as I refresh my page it's empty again?This is my constructor.
And this is the method I always call inside my methods calling the API.
What am I doing wrong here?
@jwilsson commented on GitHub (Aug 29, 2016):
Hi,
Sorry for the late reply.
The library doesn't actually remember the time between page reloads, it just sets it whenever you request or refresh a token. If you save it yourself somewhere between page reloads and read the value from there it should work correctly.