Skip to content

Tag: token

Strange thing with PHP token confirmation

Before submitting the form, I check if the token matches like this: HTML: And for some reason, else is always triggered, although in theory the check should occur when sending data. What could be the problem? UPD.And besides, the error text is constantly visible at the top of the page, although I display all …

Extract token from response url – Spotify API

I’m using this code to get a token from Spotify’s Web API: That results in this showing up in the browser: Great! But how do I extract “{token}” from the response and use it as a parameter in a request to the API? For example in the request to https://api.spotify.com/v1/users/{user_id}…

Generating cryptographically secure tokens

In order to generate a 32 character token for access to our API we currently use: I have read that this method is not cryptographically secure as it’s based on the system clock, and that openssl_random_pseudo_bytes would be a better solution as it would be harder to predict. If this is the case, what wo…