note 129832 added to function.session-set-save-handler
| From: | polygon.co.in@gmail.com | Date: | Sat, 02 Nov 2024 16:00:48 +0000 |
| Subject: | note 129832 added to function.session-set-save-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221625@lists.php.net to get a copy of this message | ||
Here is a package containing Collection of Mostly used Session Handlers
https://github.com/polygoncoin/SessionHandlers
- Supports File / MySql / Redis / Memcached / Cookie based Session Handlers
- Supports Readonly mode as well for all the above mentioned Session Handlers
<?php
include __DIR__ . '/CustomSessionHandler/Session.php';
// Initialise Session Handler
Session::initSessionHandler('File');
// Session::initSessionHandler('MySql');
// Session::initSessionHandler('Redis');
// Session::initSessionHandler('Memcached');
// Session::initSessionHandler('Cookie');
// Start session in readonly mode
// Use when user is already logged in and we need to authorise the client cookie.
Session::start_readonly();
if (isset($_SESSION)) {
print_r($_SESSION);
}
// Auth Check
// if (!isset($_SESSION) || !isset($_SESSION['id'])) {
// die('Unauthorised');
// }
// Start session in normal (read/write) mode.
// Use once client is authorised and want to make changes in $_SESSION
Session::start_rw_mode();
$_SESSION['id'] = rand();
?>
The package doesn't create empty sessionData entries in container for cases such as DDoS.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 103.58.155.243)
----
Manual Page -- https://php.net/manual/en/function.session-set-save-handler.php
Edit -- https://main.php.net/note/edit/129832
Del: integrated -- https://main.php.net/note/delete/129832/integrated
Del: useless -- https://main.php.net/note/delete/129832/useless
Del: bad code -- https://main.php.net/note/delete/129832/bad+code
Del: spam -- https://main.php.net/note/delete/129832/spam
Del: non-english -- https://main.php.net/note/delete/129832/non-english
Del: in docs -- https://main.php.net/note/delete/129832/in+docs
Del: other reasons-- https://main.php.net/note/delete/129832
Reject -- https://main.php.net/note/reject/129832
Search -- https://main.php.net/manage/user-notes.php