MAPG-133 add basic CSRF protection to server side

This commit is contained in:
bence committed 2020-06-13 22:38:30 +02:00
1 parent 9e196ebf33
commit 8e0c1ce08b
2 files changed
+10

No files matched your search

+4
View File
@@ -38,3 +38,7 @@ session_start([
'cookie_httponly' => true,
'cookie_samesite' => 'Lax'
]);
if (!isset($_SESSION['anti_csrf_token'])) {
$_SESSION['anti_csrf_token'] = hash('sha256', random_bytes(10) . microtime());
}