-
Notifications
You must be signed in to change notification settings - Fork 0
/
Default.aspx.cs
52 lines (48 loc) · 1.39 KB
/
Default.aspx.cs
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
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace com.WanderingTurtle.Web
{
public partial class _Default : Page
{
private bool loggedIn = false;
/// <summary>
/// Matt Lapka
/// Created 2015/04/14
/// Sets login information based on session data
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_PreLoad(object sender, EventArgs e)
{
try
{
//attempt to get session value if they are logged in
loggedIn = (bool)Session["loggedin"];
}
catch (Exception)
{
//if it fails, the user must not have logged in on this
//session yet, so set it to false
Session["loggedIn"] = false;
}
if (loggedIn)
{
//if logged in, send them to portal page
Response.Redirect("~/portal");
}
}
/// <summary>
/// Matt Lapka
/// Created 2015/02/22
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
}
}
}