webconfig

  • Thread starter Thread starter Jenny
  • Start date Start date
J

Jenny

Hi all

I'm using forms authentication for my page. My webconfig
(parts):

<authentication mode="Forms" >
<forms
name="AuthCookie"
path="\"
loginUrl="Login.aspx"
protection="All"
timeout="200">
<credentials passwordFormat="Clear">
<user name="Test" password="Password" />
</credentials>
</forms>
</authentication>

<authorization>

<deny users="?" />

</authorization>
</system.web>
<location path="start.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Login.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
</configuration>

If I use instead:
<authorization>
<allow users="*" />
</authorization>

everthing works fine.
If I do login correct I can't find a authentification
cookie in IE (in Netscape an authentification cookie can be
found).
After login the same page is shown with the following url:
http://localhost/..../Login.aspx?ReturnUrl=/TL_NET/Selection.aspx

My forms-code is:

If (FormsAuthentication.Authenticate(TextBox_Name.Text,
TextBox_Password.Text)) Then
FormsAuthentication.SetAuthCookie(TextBox_Name.Text,False)
Response.Redirect("Selection.aspx", True)
....

Is there someting wrong?

Thanks a lot for help!

Jenny
 
Hi Jenny,

Try to these two changes together:

1. replace
<authorization>
<deny users="?" />
</authorization>

with
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>

2. replace
FormsAuthentication.SetAuthCookie(TextBox_Name.Text,False)
Response.Redirect("Selection.aspx", True)

with
FormsAuthentication.RedirectFromLoginPage(TextBox_Name.Text,True)
 
Back
Top