0
I need to set the SESSION time of my site, which I took from another developer.
Session settings are used from a ready-made file, Session.php
Follow the code of that file:
<?php
// classe para gerenciar sessão
Class Session extends Singleton {
protected function __construct() {
if(!session_start()) {
session_start();
}
}
public static function define($key,$val) {
$classe = self::instance();
$_SESSION[$key] = $val;
}
public static function apaga($key) {
$classe = self::instance();
unset($_SESSION[$key]);
}
public static function limpa() {
$classe = self::instance();
$_SESSION = array();
}
public static function retorna($key) {
$classe = self::instance();
if(!empty($_SESSION[$key])) {
return $_SESSION[$key];
} else {
return false;
}
}
public static function define_dados($data = array()) {
if(is_array($data)) {
foreach($data as $key=>$val) {
$_SESSION[$key] = $val;
}
}
}
public static function fecha() {
session_write_close();
}
}
?>
How could I set this time to 1 hour, for example? I tried several things I searched on the internet, but nothing. Someone has some light?