src/Framework/Form/Element/Input/Csrf.php
public function createNewToken($value, $expire = 300)
    {
        $this->token = [
            'value'  => sha1(rand(10000, getrandmax()) . $value),
            'expire' => (int)$expire,
            'start'  => time()
        ];
        $_SESSION['pop_csrf'] = serialize($this->token);
        return $this;
    }
public function createNewToken($value, $expire = 300)
    {
        $this->token = [
            'value'  => sha1(rand(10000, getrandmax()) . $value),
            'expire' => (int)$expire,
            'start'  => time()
        ];
        $_SESSION['pop_csrf'] = serialize($this->token);
        return $this;
    }
public function createNewToken ( $ value , $ expire = 300 ) { $ this -> token = [ 'value' => sha1 ( rand ( 10000 , getrandmax ( ) ) . $ value ) , 'expire' => ( int ) $ expire , 'start' => time ( ) ] ; $ _SESSION [ 'pop_csrf' ] = serialize ( $ this -> token ) ; return $ this ; }
Set the token of the csrf form element

@param  string $value
@param  int    $expire
@return Csrf
Set the token of the csrf form element