DEV Community

loading...

Discussion on: What was your win this week?

Collapse
manuthecoder profile image
Manu • Edited

Let's see....

  • Played some minecraft :D
  • Fixed all bugs in my app...
  • Added a feature to check if user is logged in or not every minute, and check if the session timed out
    window.addEventListener('load', function(){
        var interval = setInterval(function() {
            var xhttp = new XMLHttpRequest();
            xhttp.onreadystatechange = function() {
                if (this.readyState == 4 && this.status == 200) {
                   if(xhttp.responseText.toString() !== "true") {
                       window.location = "https://smartlist.ga/dashboard/login.php?inactive"
                   }
                }
            };
            xhttp.open("GET", "https://smartlist.ga/dashboard/user/check_if_loggd_in.php", true);
            xhttp.send();
        }, 60000)
    })
Enter fullscreen mode Exit fullscreen mode

... And found a bug on dev.to!
https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xvhuo0a32ijh7i1evd5a.PNG