1

I use forms authentication in web application. I have this in my config file. I use IIS 7

<forms loginUrl="~/Account/Login.aspx" cookieless="UseCookies" protection="All" 
       name=".ASPXAUTH" timeout="60" requireSSL="false" slidingExpiration="true"  
   enableCrossAppRedirects="false" defaultUrl="~/Dashboard.aspx" />

When i enter my site's url in the address bar it redirects me to

Account/Login.aspx?ReturnUrl=%2f instead of Account/Login.aspx

I don't know what the reason is , but when i use IIS 5.1 everything works fine.

Please help me.

2 Answers 2

1

Forms authentication redirection puts the source URL into the login.aspx request as a parameter so it can return the user the to the page they entered. %2f = /, e.g. the root of your site. If you had entered the www.example.com/coolstuff.aspx your ReturnUrl parameter would be '%2fcoolstuff.aspx'.

Nothing is wrong, that is how forms authentication is suppose to work.

Sign up to request clarification or add additional context in comments.

Comments

1

One option is to hide the URL in the browser address bar:

<script>
    if (history.replaceState) {
        history.replaceState({}, document.title, '//' + location.host + location.pathname);
    }
</script>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.