mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-08 00:34:42 +03:00
Make CSRF token more secure
This commit is contained in:
parent
a6d1008242
commit
58e8dcd5f6
@ -55,7 +55,7 @@ function print_csrf_token_in_url()
|
||||
function setcsrftoken()
|
||||
{
|
||||
if (!isset($_SESSION['csrf_token'])) {
|
||||
$_SESSION['csrf_token'] = sha1(rand(10000000, 99999999));
|
||||
$_SESSION['csrf_token'] = sha1(session_id() . (function_exists('openssl_random_pseudo_bytes') ? openssl_random_pseudo_bytes(32) : (time() + microtime()) . mt_rand(0, 99999999)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user