This commit is contained in:
Vojtěch Sajdl
2018-01-03 14:15:45 +01:00
parent e7df74cad8
commit 9820686776
9 changed files with 50 additions and 36 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ class Token
{
global $mysqli;
$salt = uniqid(mt_rand(), true);
$token = hash('sha256', $seed.$salt);
$token = hash('sha256', $id.$salt);
$stmt = $mysqli->prepare("INSERT INTO tokens VALUES(?, ?, ?, ?)");
$stmt->bind_param("siis", $token, $id, $expire, $data);
$stmt->execute();