Forms Authentication loginURL not redirecting to root Default.aspx after timeout

Clash Royale CLAN TAG#URR8PPP
Forms Authentication loginURL not redirecting to root Default.aspx after timeout
I have an application where the root Default.aspx page is the login page. Logging
into the application works properly, and all other web pages are in subdirectories. Once on a subdirectory page, if the application times out, the application should return back to the root directory default.aspx for re-login. Instead it is trying to call a default page in the subdirectory which doesn't exist. Ex: /subdirA/subdirB/Default.aspx, when it should try to run just Default.aspx. Following is what I have in my web.config:
<authentication mode="Forms">
<forms loginUrl="/Default.aspx" timeout="10"/>
</authentication>
I have also tried "~Default.aspx", "~/Default.aspx", and "Default.aspx" none work.
I found some hints to add the following to appSettings:
This did not work either. Am at a loss, any help is appreciated!
Update
It looks like my application isn't using the loginUrl at all. I made a dummy front page for default.aspx, and moved the login page to /login/login.aspx, and changed the loginUrl to /login/login.aspx. Logged into the app and went to a page in a subdirectory, and let it timeout. It still tries to go to /subdirA/subdirB/Default.aspx. Why would it not use the loginUrl at all?
It looks like my application isn't using the loginUrl at all. I made a dummy front page for default.aspx, and moved the login page to /login/login.aspx, and changed the loginUrl to /login/login.aspx. Logged into the app and went to a page in a subdirectory, and let it timeout. It still tries to go to /subdirA/subdirB/Default.aspx. Why would it not use the loginUrl at all?
– K. Williams
Aug 6 at 21:25
1 Answer
1
I found the issue - there was a redirect in the masterpage that was not working correctly. Changed this to ~/Default.aspx and is now working properly.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
What happens if you explicitly logout from one of the sub-directory pages? Also, have you ensured that there is no redirect in place?
– Mohsin Mehmood
Aug 6 at 19:31