From 7076343338ae3439f3c86f01144818abe8c31978 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Sun, 12 Mar 2023 07:16:23 +0200 Subject: add container helpers; constuct public directory-tree --- tests/code/session.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/code/session.php (limited to 'tests/code/session.php') diff --git a/tests/code/session.php b/tests/code/session.php new file mode 100644 index 0000000..478160a --- /dev/null +++ b/tests/code/session.php @@ -0,0 +1,50 @@ +'; +echo "\n(in) ". session_id(); + +echo "\nsesion path: ". session_save_path(); + +if (isset($_SESSION['c'])) { + echo "\nexist:". print_r($_SESSION['c'], true); + +} else { + $number = [ + rand(1,1000), + rand(1,1000), + rand(1,1000) + ]; + echo "\ncreated random:". print_r($number, true); + $_SESSION['c'] = $number; +} + +session_regenerate_id(); +echo "\n(out) ". session_id(); + +echo ''; +### class SomeSessionHandler extends SessionHandler +### { +### private $key; +### +### public function __construct() +### { +### // nothing +### } +### +### public function close() +### { +### return parent::close(); +### +### } +### +### } +### +### // we'll intercept the native 'files' handler, but will equally work +### // with other internal native handlers like 'sqlite', 'memcache' or 'memcached' +### // which are provided by PHP extensions. +### // ini_set('session.save_handler', 'files'); +### +### $handler = new SomeSessionHandler(); +### session_set_save_handler($handler, true); +### session_start(); +### +### echo 'hm!'; -- cgit v1.2.3