$(function()
{
    const queryString = window.location.search;
    const urlParams = new URLSearchParams(queryString);
    const data = urlParams.get('data')

    function timeChecker()
    {
        setInterval(function()
        {
            var storedTimeStamp = sessionStorage.getItem("lastTimeStamp");  
            timeCompare(storedTimeStamp);
        },10000);
    }


    function timeCompare(timeString)
    {
        var maxMinutes  = 1;  //GREATER THEN 1 MIN.
        var currentTime = new Date();
        var pastTime    = new Date(timeString);
        var timeDiff    = currentTime - pastTime;
        var minPast     = Math.floor( (timeDiff/60000) );
        if( minPast > maxMinutes)
        {
            sessionStorage.removeItem("lastTimeStamp");
            /*<?php
            $_SESSION['success_msg'] = "Reset Password Link Expired...";
            ?>*/

            window.location = "reset-password.php?act=<?php echo base64encode(1);?>&data="+data;
        }
    } 

    var timeStamp = new Date();
    sessionStorage.setItem("lastTimeStamp",timeStamp);
    timeChecker();
});//END JQUERY