Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void ForceLogin()
- {
- HttpCookie cookie = HttpContext.Current.Request.Cookies[cookieName];
- if (cookie != null)
- {
- if (Regex.IsMatch(cookie.Value, "^[0-9]+\.[a-f0-9]+$"))
- {
- using (EibxDataContext db = new EibxDataContext())
- {
- int count = db.Logins.Count(l => l.Password == cookie.Value);
- if (count == 1)
- {
- return;
- }
- }
- }
- }
- HttpContext.Current.Response.Redirect("~/Login.aspx");
- }
Add Comment
Please, Sign In to add comment