-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsession.php
More file actions
24 lines (17 loc) · 769 Bytes
/
session.php
File metadata and controls
24 lines (17 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// Load configuration
include_once(dirname(__FILE__) . "/config/config.inc.php");
header('Content-Type: text/html; charset=utf-8');
if (isset($CONFIG['php_session_timeout']) && $CONFIG['php_session_timeout'] > 0) {
// Set the maxlifetime of session
ini_set("session.gc_maxlifetime", $CONFIG['php_session_timeout']);
// Also set the session cookie timeout to 0 (until the browser is closed)
ini_set("session.cookie_lifetime", 0);
}
session_start();
if (!isset($_SESSION['login']) || ! $_SESSION['login']) {
header('Location: login');
}
if (!isset($_SESSION['invitations'])) $_SESSION['invitations'] = json_encode(array());
include('templates/session.html')
?>