A Help about a ejs

I have an app.js file where I have:

res.render("index", {
Login:true
})

and a file header.ejs where

<%if (Login) {%>
        <ul class="nav justify-content-end">
          <li class="nav-item">
            <a class="nav-link h3" href="#">Logout</a>
          </li>
        </ul>
    <%} else {%>
        <ul class="nav justify-content-end">
              <li class="nav-item">
                <a class="nav-link h3" href="#" >Login</a>
              </li>
              <li class="nav-item">
                <a class="nav-link h3" href="#" id="Register">Register</a>
              </li>
        </ul>
    <%}%>

How can I change the value of “Login” when one of the links is clicked?

example: click on logout, Login change to false and Navigation change

What you probably need is sessions: https://github.com/expressjs/session

In other words, a persistent way to store the state of your application over time. Databases could be used for this also but using a session is a better solution for this.