scratch – Blame information for rev 96
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
96 | office | 1 | <?php |
2 | |||
3 | ########################################################################### |
||
4 | ## Copyright (C) Wizardry and Steamworks 2017 - License: GNU GPLv3 ## |
||
5 | ########################################################################### |
||
6 | |||
7 | session_start(); |
||
8 | |||
9 | if (empty($_SESSION['token'])) { |
||
10 | if (function_exists('mcrypt_create_iv')) { |
||
11 | $_SESSION['token'] = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)); |
||
12 | } else { |
||
13 | $_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32)); |
||
14 | } |
||
15 | } |
||
16 | |||
17 | echo $_SESSION['token']; |
||
18 |