Guest User

Untitled

a guest
Nov 20th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. if (System.Web.HttpContext.Current.Items["TokenLogin"] == null)
  2. {
  3. var httpCookie = Request.Cookies["PermitidoUtilizarSistemaLog"];
  4. if (httpCookie != null && ConfigurationManager.AppSettings["tokenPedidoWeb"].Equals(httpCookie.Value))
  5. {
  6. System.Web.HttpContext.Current.Items.Add("TokenLogin", httpCookie.Value);
  7. httpCookie.Expires = DateTime.Now;
  8. }
  9. }
  10. else
  11. {
  12. if (!System.Web.HttpContext.Current.Items["TokenLogin"].Equals(ConfigurationManager.AppSettings["tokenPedidoWeb"]))
  13. return Redirect("acesso");
  14. }
Add Comment
Please, Sign In to add comment