Metamask wallet is logged out every time the page refreshes

Hello, I am trying to create a login button that logs a user in metamask wallet and authenitcates. I have that working. I also have the page loaded with all NFTs connected to a smart contract I wrote. My issue is I would like to have multiple webpages and still keep metamask logged in. But when the page refreshes or another page is clicked, metamask is logged out. Is there anyway to keep metamask logged in as long as the server is running.

Appreciate the Help!

async function login_metamask() {
  Moralis.authenticate().then(function (user) {
    console.log(user.get('ethAddress'))
    //const currentUser = Moralis.User.current();
    console.log('user logged in');
    console.log(currentUser)
      Moralis.enableEncryptedUser();
      Moralis.secret = 'My Secret Key'
      console.log(currentUser)
      document.getElementById("metadataName").innerText = "User logged in via wallet : " + user.get('ethAddress');
      document.getElementById("metadataName").style.visibility = "visible";
      document.getElementById("btn-logout").style.visibility = "visible";
      document.getElementById("btn-viewnft").style.visibility = "visible";
      document.getElementById("btn-login").style.visibility = "hidden";
      document.getElementById("metadataDescription").style.visibility = "visible";
      document.getElementById("form").style.visibility = "visible";
      document.getElementById("nameFile").style.visibility = "visible";
      
   

You can do something like in the below code to check if the user exists in local storage and correct the UI. The user doesnโ€™t disconnect until you use Moralis.User.logOut(); function.

if (Moralis.User.current() != null) {

document.getElementById("metadataName").innerText = "User logged in via wallet : " + user.get('ethAddress');
      document.getElementById("metadataName").style.visibility = "visible";
      document.getElementById("btn-logout").style.visibility = "visible";
      document.getElementById("btn-viewnft").style.visibility = "visible";
      document.getElementById("btn-login").style.visibility = "hidden";
      document.getElementById("metadataDescription").style.visibility = "visible";
      document.getElementById("form").style.visibility = "visible";
      document.getElementById("nameFile").style.visibility = "visible";
   
  }

Yes I have done that, but everytime I refresh the page the login button reappears and the page resets to what it was prior to metamask authentication. Only difference would be that know when I click login, the page automatically shows results without metamask authentication (assuming session is saved). But what I am looking for is regardless of page refresh the results should be on the screen until I click โ€œlog outโ€