public static function makeCsrfToken($time = null)
    {
        if (Session::getInstance()->has('__bow.csrf')) {
            return true;
        }

        if (is_int($time)) {
            static::$expirate_at = $time;
        }

        $token = static::make();

        Session::getInstance()->add('__bow.csrf', [
            'token' => $token,
            'expirate' => time() + static::$expirate_at,
            'field' => '<input type="hidden" name="_token" value="' . $token .'"/>'
        ]);

        Session::getInstance()->add('_token', $token);

        return true;
    }
public static function makeCsrfToken($time = null)
    {
        if (Session::getInstance()->has('__bow.csrf')) {
            return true;
        }

        if (is_int($time)) {
            static::$expirate_at = $time;
        }

        $token = static::make();

        Session::getInstance()->add('__bow.csrf', [
            'token' => $token,
            'expirate' => time() + static::$expirate_at,
            'field' => '<input type="hidden" name="_token" value="' . $token .'"/>'
        ]);

        Session::getInstance()->add('_token', $token);

        return true;
    }
public static function makeCsrfToken ( $ time = null ) { if ( Session :: getInstance ( ) -> has ( '__bow.csrf' ) ) { return true ; } if ( is_int ( $ time ) ) { static :: $ expirate_at = $ time ; } $ token = static :: make ( ) ; Session :: getInstance ( ) -> add ( '__bow.csrf' , [ 'token' => $ token , 'expirate' => time ( ) + static :: $ expirate_at , 'field' => '<input type="hidden" name="_token" value="' . $ token . '"/>' ] ) ; Session :: getInstance ( ) -> add ( '_token' , $ token ) ; return true ; }
Csrf token creator

@param  int $time
@return bool
Csrf token creator