fixes #4058 loginForm macro is not showing the logout link

Fixed the issue and pushed the code for review, please check it.