Home » » session_set_save_handler

session_set_save_handler

Written By 1 on Monday, October 1, 2012 | 6:23 PM

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:


<?php
class 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.


0 Comment:

Post a Comment