« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 2 of about 2 for MySessionHandler (0.001 sec.)
SessionHandlerInterface クラス | PHP 8.3 11228
SessionHandlerInterface クラス (PHP 5 >= 5.4.0, PHP 7, PHP 8) はじめに SessionHandlerInterface は カスタムセッションハンドラを作成する際の最低限のプロトタイプを定義したインターフェイスです。 自作のセッションハンドラを オブジェクト指向型 の起 ... な 検証/無害化 が必須になる値です。 よって、ここで示した例を改変することなく、 本番の実環境で用いないでください <?php class MySessionHandler implements SessionHandlerInterface { private $savePath ; public function open ( $savePath , $sessionName ): bool { $this - ... time ( $file ) + $maxlifetime < time () && file_exists ( $file )) { unlink ( $file ); } } return true ; } } $handler = new MySessionHandler (); session_set_save_handler ( $handler , true ); session_start (); // $_SESSION への値の設定や格納されている値の取得を進め ...
https://man.mtool.work/php/8.3/class.sessionhandlerinterface.html
session_set_save_handler — ユーザー定義のセッション保存関数を設定する | PHP 8.3 7485
session_set_save_handler (PHP 4, PHP 5, PHP 7, PHP 8) session_set_save_handler — ユーザー定義のセッション保存関数を設定する 説明 function session_set_save_handler ( callable $open , callable $close , callable $read , callable $write , calla ... ていることに注目しましょう。 オブジェクトをセッション保存ハンドラとして使うときには、この方法をおすすめします。 <?php class MySessionHandler implements SessionHandlerInterface { // ここでインターフェイスを実装します } $handler = new MySessionHandler (); session_s ...
https://man.mtool.work/php/8.3/function.session-set-save-handler.html
PREV 1 NEXT