Authentication Keeps returning to Login Page

D

dave

I have the following problem:

my web.config file (see below) protects the entire website and when a user
tries to go to a page they are redirected to the login - all is well..

However, even though they have been authenticated it is still returning to
the login page. However if i then go to the original page i wanted it will
let me in, as i have now been authenticated, so that part is working...

The login code is straight forward enough (see below), but i cannot for the
life of me work out why it keeps returning to the login page. I have tried
many variations to get me to the originally requested page, but no success.

Thanks in advance..

Web Config settings.

<configuration>
<system.web>
<customErrors mode="Off"/>
<pages smartNavigation="true"/>
<compilation debug="true"/>

<authentication mode="Forms" >
<forms name="App1" path="/" loginUrl="login.aspx" >
<credentials passwordFormat="Clear">
<user name="tester" password="testing" />
</credentials>
</forms>
</authentication>


<authorization>
<allow users="tester"/>
<deny users="?"/>
</authorization>
</system.web>

</configuration>


Login Code.

sub DoLogin(objSender as Object, objArgs As EventArgs)
if FormsAuthentication.Authenticate(username.value, password.value) then
formsauthentication.redirectfromloginpage(username.value, "False")
end if
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top