[GH-ISSUE #34] refreshAccessToken leads to blank page #19

Closed
opened 2026-02-27 19:25:39 +03:00 by kerem · 2 comments
Owner

Originally created by @BillyCallahan on GitHub (May 11, 2015).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/34

Hello,

I have a problem using the API: when I use the refreshAccessToken() function I get a blank page.
In local it works, but when I upload it on my server it stops working...Would you know why ?

Here's the code:

$session = new SpotifyWebAPI\Session('730c01f53af44936a0cc51459f0cb0ea', 'e1fc633ca35141bdb6edca04632850e7', '');
$api = new SpotifyWebAPI\SpotifyWebAPI();
$refreshToken = $_SESSION['refreshToken'];
$session->setRefreshToken($refreshToken);
$session->refreshAccessToken();
$accessToken = $session->getAccessToken();
// Request a access token using the code from Spotify
$refreshToken = $session->getRefreshToken();
$_SESSION['refreshToken'] = $refreshToken;
// Set the new access token on the API wrapper
$api->setAccessToken($accessToken);

Originally created by @BillyCallahan on GitHub (May 11, 2015). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/34 Hello, I have a problem using the API: when I use the refreshAccessToken() function I get a blank page. In local it works, but when I upload it on my server it stops working...Would you know why ? Here's the code: $session = new SpotifyWebAPI\Session('730c01f53af44936a0cc51459f0cb0ea', 'e1fc633ca35141bdb6edca04632850e7', ''); $api = new SpotifyWebAPI\SpotifyWebAPI(); $refreshToken = $_SESSION['refreshToken']; $session->setRefreshToken($refreshToken); $session->refreshAccessToken(); $accessToken = $session->getAccessToken(); // Request a access token using the code from Spotify $refreshToken = $session->getRefreshToken(); $_SESSION['refreshToken'] = $refreshToken; // Set the new access token on the API wrapper $api->setAccessToken($accessToken);
kerem closed this issue 2026-02-27 19:25:39 +03:00
Author
Owner

@jwilsson commented on GitHub (May 11, 2015):

Could you enable PHP error reporting, either via php.ini or by adding these lines at the top of the file:

error_reporting(-1);
ini_set('display_errors', 1);

And then post the error here?

<!-- gh-comment-id:100785778 --> @jwilsson commented on GitHub (May 11, 2015): Could you enable PHP error reporting, either via php.ini or by adding these lines at the top of the file: ``` error_reporting(-1); ini_set('display_errors', 1); ``` And then post the error here?
Author
Owner

@BillyCallahan commented on GitHub (May 11, 2015):

Hello :)
Thanks for helping, I tried this and it appears that the problem came from an Invalid URI...
I'm sorry to bother you for this kind of errors, but now I know how to display errors at least.

Thanks again,
Audric Manaud.

<!-- gh-comment-id:100887616 --> @BillyCallahan commented on GitHub (May 11, 2015): Hello :) Thanks for helping, I tried this and it appears that the problem came from an Invalid URI... I'm sorry to bother you for this kind of errors, but now I know how to display errors at least. Thanks again, Audric Manaud.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#19
No description provided.