| 1 | <?php |
||
| 24 | class Csrf |
||
| 25 | { |
||
| 26 | /** |
||
| 27 | * get CSRF token and generate a new one if expired |
||
| 28 | * |
||
| 29 | * @access public |
||
| 30 | * @static static method |
||
| 31 | * @return string |
||
| 32 | */ |
||
| 33 | public static function makeToken() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * checks if CSRF token in session is same as in the form submitted |
||
| 50 | * |
||
| 51 | * @access public |
||
| 52 | * @static static method |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | public static function isTokenValid() |
||
| 60 | } |
||
| 61 |