Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <script type="text/javascript">
  2. function revisaVariableSesion() {
  3. var sesionValida = '<%= Session["sesionValida"] %>';
  4. if(!sessionValida)
  5. window.location = "LogOut.aspx";
  6. }
  7. var interval = setInterval(
  8. function () {
  9. revisaVariableSesion();
  10. }, 5000);
  11. </script>
  12.  
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. try
  16. {
  17. Session.Abandon();
  18. FormsAuthentication.SignOut();
  19. Response.Cache.SetCacheability(HttpCacheability.NoCache);
  20. Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
  21. Response.Expires = -1000;
  22. Response.CacheControl = "no-cache";
  23.  
  24. catch (Exception ex)
  25. {
  26. Response.Write(ex.Message);
  27. }
  28. Response.Redirect("/Login.aspx");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement