function __construct() { if (!self::$iniciada) { session_start(); $this->_control(); } self::$iniciada = true; }
function __construct($nombre = NULL) { if ($nombre != NULL) { session_name($nombre); } if (!self::$iniciada) { session_start(); } self::$iniciada = true; }
function __construct($nombre = null) { if (!self::$iniciada) { if ($nombre != null) { session_name($nombre); } session_start(); $this->_control(); self::$iniciada = true; } }
function __construct($nombre = "null") { if (!self::$iniciada) { //le pongo el nombre de sesión para poder distinguir sesiones //de distinto tipo if ($nombre != null) { session_name($nombre); } session_start(); $this->_control(); self::$iniciada = true; } }
function __construct() { if (!self::$iniciada) { session_start(); // $this->_control(); $ip = $this->get("_ip"); $cliente = $this->get("_cliente"); if ($ip == null && $cliente == null) { $this->set("_ip", Server::getClientAddres()); $this->set("_cliente", Server::getUserAgent()); } else { if ($ip !== Server::getClientAddres() || $cliente !== Server::getUserAgent()) { $this->destroy(); //$this->truested = false; // Esto lo podemos usar como alternativa (lo veremos más adelante) } } } self::$iniciada = true; }
function __construct($nombre = NULL) { if ($nombre != NULL) { session_name($nombre); } if (!self::$iniciada) { session_start(); $ip = $this->get('_ip'); $cliente = $this->get('_cliente'); if ($ip == null && $cliente == null) { $this->set('_ip', Server::getClientAddress()); $this->set('_cliente', Server::getUserAgent()); } else { if ($ip !== Server::getClientAddress() || $cliente !== Server::getUserAgent()) { session_destroy(); //$this->trusted=false; } } } self::$iniciada = true; }