Hi @Zeljko Zaric ,
According to your description, when you are redirected to the default.aspx after passing the form authentication, and then click the button on the default.aspx to connect to the IIS virtual directory, you need to click the login form again for authentication. I can't reproduce your problem because the code you provided is incomplete. But I think the reason why the request is redirected to the logon.aspx page again may be that the form authentication cookie is missing, because the user is identified based on the authentication cookie, at some point, the client sends a request to the server, and the FormsAuthenticationModule class does not receive it cookie, you can determine if a request does not contain a cookie by enabling cookie logging in IIS. Also, forms-based authentication requires your clients to accept or enable cookies on their browsers.
For implementing forms-based authentication in an ASP.NET application, you can refer to this document: https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/aspnet/development/forms-based-authentication
For forms authentication troubleshooting, you can refer to this document: https://learn.microsoft.com/en-us/iis/troubleshoot/security-issues/troubleshooting-forms-authentication
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the email notification for this thread.
Best regards,
Yurong Dai