-
Notifications
You must be signed in to change notification settings - Fork 0
/
loginPage.php
47 lines (46 loc) · 1.73 KB
/
loginPage.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
46
47
lsp<?php
session_start();
//check for last activity, and kill session as needed
if (isset($_SESSION['lastActivity'])) {
if ($_SESSION['stayLoggedIn'] == true) {
if (time() - $_SESSION['lastActivity'] > 2592000) {
session_unset();
session_destroy();
header("Location:../shared_php/session_expired.php");
}
} else if (time() - $_SESSION['lastActivity'] > 1800) {
session_unset();
session_destroy();
header("Location:../shared_php/session_expired.php");
}
} else {
$_SESSION['lastActivity'] = time(); // update last activity time stamp
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Login Form</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/layout.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="form-bg">
<form id="login" method="POST" action="login.php">
<h2>Login</h2>
<input type="text" placeholder="Email" name="username" id="username">
<br />
<input type="password" placeholder="Password" name="password" id="password">
<br />
<button type="submit" class="button" style="float:right;display:block;margin-right:40px">Login</button>
<div style="padding-left:20px">
<input type="checkbox" id="remember" name="remember" value="remember" />
<span>Keep me logged in</span>
<br />
<a href="shared_php/forget_pass.php">Forgot your password?</a>
</div>
</form>
</div>
</body>
</html>