forked from abhishekdelta/digitalfortress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
session.inc.php
executable file
·46 lines (38 loc) · 1.08 KB
/
session.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
$cookie_path = "/";
$cookie_timeout = 60 * 30; // in seconds//60 * 30
$garbage_timeout = $cookie_timeout + 300; // in seconds //300
ini_set('session.name',"PHPSESSID");
session_set_cookie_params($cookie_timeout, $cookie_path);
ini_set('session.gc_maxlifetime', $garbage_timeout);
$sessdir = "../sessions";
if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
ini_set('session.save_path', $sessdir);
function ae_nocache()
{
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
}
ae_nocache();
session_start();
ini_set('display_errors',1);
require_once("../auth.lib.php");
require_once("../mysql.inc.php");
mysqlConnect();
if(!checkSessionAuth())
{
showWarning(1);
exit(1);
}
if(isLevelCompleted($LEVELNAME))
{
showWarning(2);
exit(1);
}
$USERLOGGEDIN=true;
updateUserAttempt($LEVELNAME);
$LEVELPOINTS=getLevelPoints($LEVELNAME);
?>