Tuesday 2 October 2012

session_set_save_handler

bool session_set_save_handler ( callable $open , callable $close , callable $read , callable $write , callable $destroy , callable $gc )
Sets user-level session storage functions
Since PHP 5.4 it is possible to register the following prototype:

<?phpclass MySessionHandler implements SessionHandlerInterface{
    
// implement interfaces here}
$handler = new MySessionHandler();session_set_save_handler($handlertrue);session_start();
// proceed to set and retrieve values by key from $_SESSION

5.4.0 Added SessionHandlerInterface for implementing session handlers and SessionHandler to expose internal PHP session handlers.