Redirect not working
From: Ldraw (Ldraw_at_discussions.microsoft.com)
Date: 12/29/04
- Next message: Tim Mavers: "Re: Accessing ActiveDirectory through LDAP with .NET"
- Previous message: Paul Clement: "Re: Role Based Forms Auth with Active Directory"
- Next in thread: Mark Miller: "Re: Redirect not working"
- Reply: Mark Miller: "Re: Redirect not working"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 29 Dec 2004 10:27:01 -0800
I have looked at all the Redirect questions on this site without finding a
resoultion
to my redirect problem. I am using sample code to verify a user and
password from a login page but although the verification is successful and I
can see that the return url is where I need to go I am continously looped
back to the login page.
Cookies are enabled. See code example below.
--WebConfig--
<authentication mode="Forms">
<forms name="TestLoginAthu" path="/" loginUrl="WebForm1.aspx"
protection="All" timeout="30">
<credentials passwordFormat="Clear">
<user name="jeff" password="test" />
<user name="mike" password="test" />
</credentials>
</forms>
</authentication>
--Code Behind
HttpCookie cookie = FormsAuthentication.GetAuthCookie ( TextBox1.Text,
CheckBox1.Checked );
// Expires in 30 days, 12 hours and 30 minutes from today.
cookie.Expires = DateTime.Now.Add(new TimeSpan(30, 12, 30, 0));
Response.Cookies.Add (cookie);
string strUrl = FormsAuthentication.GetRedirectUrl ( TextBox1.Text,
CheckBox1.Checked );
Response.Redirect( strUrl );
- Next message: Tim Mavers: "Re: Accessing ActiveDirectory through LDAP with .NET"
- Previous message: Paul Clement: "Re: Role Based Forms Auth with Active Directory"
- Next in thread: Mark Miller: "Re: Redirect not working"
- Reply: Mark Miller: "Re: Redirect not working"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|