0

My ejs layout provides the current user's username on the main menu through sessions

            <a href="">
          <% if (typeof currentUser === 'undefined'){%>
            <% } else { %>
            <a style="text-decoration:none;" href="/users/logout">Logout</a>
            <% } %>

        </a>

Now when I destroy the session and redirect to the main page, the currentUser's infomation is still showing, although logging currentuser returns undefined. Is there a way to force the layout to update itself to show current information?

0 Answers0