note 83096 added to function.session-set-save-handler
| From: | anddriga at gmail dot com | Date: | Fri, 09 May 2008 17:44:01 +0000 |
| Subject: | note 83096 added to function.session-set-save-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139222@lists.php.net to get a copy of this message | ||
Some PHP code for memcached session handler.
class SessionHadler
{
private static $lifetime = 0;
public static function open()
{
self::$lifetime = ini_get('session.gc_maxlifetime');
return true;
}
public static function read($id)
{
return memcached::get("sessions/{$id}");
}
public static function write($id, $data)
{
return memcached::set("sessions/{$id}", $data, self::$lifetime);
}
public static function destroy($id)
{
return memcached::delete("sessions/{$id}");
}
private function __construct(){}
public static function gc(){ return true; }
public static function close(){ return true; }
public function __destruct()
{
session_write_close();
}
}
----
Server IP: 91.196.196.241
Probable Submitter: 92.113.144.200
----
Manual Page -- http://www.php.net/manual/en/function.session-set-save-handler.php
Edit -- https://master.php.net/note/edit/83096
Del: integrated -- https://master.php.net/note/delete/83096/integrated
Del: useless -- https://master.php.net/note/delete/83096/useless
Del: bad code -- https://master.php.net/note/delete/83096/bad+code
Del: spam -- https://master.php.net/note/delete/83096/spam
Del: non-english -- https://master.php.net/note/delete/83096/non-english
Del: in docs -- https://master.php.net/note/delete/83096/in+docs
Del: other reasons-- https://master.php.net/note/delete/83096
Reject -- https://master.php.net/note/reject/83096
Search -- https://master.php.net/manage/user-notes.php