ASP.NET Forms Authentication Problem(s)...

M

Mr.KisS

Hi,

I'm working with ASP.NET 2 (VWD). I have a Login page and a
folder to protect. I have a Database which contains
usernames & passwords.
The problem is that when i go to the protected folder it
automatically redirects me to the LOgin page with the rfeer
url. And when i login with false informations, its show me
the error panel. BUT, when i enter good informations, it
reloads the Login page as i've just arrived instead of
redirect me with authed cookie to the protected folder...
Any ideas? (sources codes after =>)

In my web.config i have this code to protect the fodler :
____
<system.web>
<authentication mode= "Forms">
<forms name=".WIZOUAUTH" loginUrl="Login.aspx"/>
</authentication>
</system.web>

<location path="members/">
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>
____

Login.aspx :
(IsGoodUser is works fine, it's the func which return if
the user exists and the password is good or not).
____
void btnLogin_Click(object sender, EventArgs e)
{
if (IsGoodUser(boxLogin.Text, boxPwd.Text) == true)
{

FormsAuthentication.RedirectFromLoginPage(boxLogin.Text, true);
}
else
{
pnlLogin.Visible = false;
pnlLogin.Enabled = false;
pnlError.Visible = true;
pnlError.Enabled = true;
}
}
____

Regards.
 
J

John Saunders

Mr.KisS said:
Hi,

I'm working with ASP.NET 2 (VWD). I have a Login page and a
folder to protect. I have a Database which contains
usernames & passwords.
The problem is that when i go to the protected folder it
automatically redirects me to the LOgin page with the rfeer
url. And when i login with false informations, its show me
the error panel. BUT, when i enter good informations, it
reloads the Login page as i've just arrived instead of
redirect me with authed cookie to the protected folder...
Any ideas? (sources codes after =>)

In my web.config i have this code to protect the fodler :
____
<system.web>
<authentication mode= "Forms">
<forms name=".WIZOUAUTH" loginUrl="Login.aspx"/>
</authentication>
</system.web>

<location path="members/">
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>

Try <deny users="?" />
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top