I need to set the SESSION time of my site, which I assumed from another developer.
Session definitions are used from a ready file, session.php
Follow the code for this 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. Does anyone have any light?