CMSimple_XH 開発者ドキュメント
XH\CSRFProtection クラス

公開メンバ関数

 __construct ($keyName='xh_csrf_token', $perRequest=false)
 
 tokenInput ()
 
 check ()
 
 store ()
 

詳解

CSRFProtection.php27 行目に定義があります。

構築子と解体子

◆ __construct()

XH\CSRFProtection::__construct (   $keyName = 'xh_csrf_token',
  $perRequest = false 
)

Initializes a new object.

引数
string$keyNameA key name.
bool$perRequestWhether a new token shall be generated for each request (otherwise once per session).

CSRFProtection.php50 行目に定義があります。

関数詳解

◆ check()

XH\CSRFProtection::check ( )

Checks whether the submitted CSRF token matches the one stored in the session. Responds with "403 Forbidden" if not.

戻り値
void

CSRFProtection.php85 行目に定義があります。

◆ store()

XH\CSRFProtection::store ( )

Stores the CSRF token in the session, if a self::tokenInput() was called.

戻り値
void

CSRFProtection.php104 行目に定義があります。

◆ tokenInput()

XH\CSRFProtection::tokenInput ( )

Returns a hidden input field with the CSRF token for inclusion in an HTML form.

戻り値
string HTML
todo:
Use cryptographically stronger token?

CSRFProtection.php69 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: