/** * Constructor */ public function __construct($name = "", $expire = null) { // factory options $this->setOption("name", "session"); $this->setOption("cookie_lifetime", 0); $this->setOption("cookie_path", "/"); $this->setOption("cookie_domain", Server::getHost()); $this->setOption("cookie_secure", Connection::isSecure()); $this->setOption("cookie_httponly", true); $this->setOption("use_only_cookies", true); $this->setOption("use_trans_sid", false); $this->setOption("entropy_file", "/dev/urandom"); $this->setOption("entropy_length", 256); $this->setOption("hash_function", "sha256"); $this->setOption("hash_bits_per_character", 6); $this->setOption("gc_maxlifetime", 86400); // 24h // set custom values $this->setName($name); $this->setExpire($expire); }
/** * Check the the server is using an HTTPS connection */ public static function isSecure() { return Connection::isSecure(); }