Protection against Cross Site Request Forgery (CSRF) attacks
This is the code documentation for the SproutCMS project
Search documentation |
class CsrfProtection against Cross Site Request Forgery (CSRF) attacks
Extending this class<?php /** * New class description goes here * * @author Your Name, 2024-11-25 **/ class NewClassName extends Csrf { /** * Gets the CSRF token in the postdata. * Checks that it is valid. * Returns TRUE on success and FALSE on failure **/ public function check () { // Method code goes here } /** * Checks the CSRF token * If it fails, redirect the user to the home page, and report an error **/ public function checkOrDie () { // Method code goes here } /** * Fetches the secret token value * * This is intended for use on JavaScript requests that require CSRF protection. * Note that it is important that this value isn't placed in GET parameters, as this * may result in the value being leaked through logging or other methods. **/ public function getTokenValue () { // Method code goes here } /** * Initialises the PHP session and, if not present, generates a CSRF secret for the session **/ protected function initialiseSession () { // Method code goes here } /** * Generates a CSRF hidden form field **/ public function token () { // Method code goes here } } ?> |
Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Monday, 3rd April, 2023 at 02:59 pm |