webconfig

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
 
A

AW

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)
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top