I have a table in my database called keys that has this structure:
id | user_id | token_id | token_key
Every time a user logs into my site, I need to generate a new token_id and token_key set for that user. How can I generate a random token for both the token_id and the token_key while keeping the two values unique?
For example, if:
token_idisdfbs98641aretwsg,token_keyissdf389dxbf1sdz51fga65dfg74asdf
Meaning:
id | user_id | token_id | token_key
1 | 1 | dfbs98641aretwsg | sdf389dxbf1sdz51fga65dfg74asdf
There can be no other row in the table with that combination of tokens. How can I do this?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire