J
Joe
I have a subfolder protected with Forms Authentication. When any page in
that folder is requested my login page comes up and the user is prompted to
login. This works fine.
Once the user info is validated I create a cookie and setup the
FormsAuthentication.
The problem I get is that the Redirect always gets kicked back to the login
page.
FormsAuthentication.Initialize();
FormsAuthenticationTicket ticket;
string cookieString;
HttpCookie cookie;
ticket = new FormsAuthenticationTicket(1,
user.Text,
DateTime.Now,
DateTime.Now.AddMinutes(30),
false,
"Data",
FormsAuthentication.FormsCookiePath);
cookieString = FormsAuthentication.Encrypt(ticket);
cookie = new HttpCookie(FormsAuthentication.FormsCookieName,
cookieString);
Response.Cookies.Add(cookie);
string strQuery = FormsAuthentication.GetRedirectUrl(user.Text,false);
Response.Redirect(strQuery);
<location path="Publisher">
<system.web>
<compilation defaultLanguage="c#" debug="true" />
<customErrors mode="Off" />
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="..\PublisherLogin.aspx" timeout="30">
</forms>
</authentication>
<authorization>
<deny users="?" />
<allow users ="*"/>
</authorization>
</system.web>
</location>
I had this problem another time but can't remember how I fixed it...
Thanks,
Joe
that folder is requested my login page comes up and the user is prompted to
login. This works fine.
Once the user info is validated I create a cookie and setup the
FormsAuthentication.
The problem I get is that the Redirect always gets kicked back to the login
page.
FormsAuthentication.Initialize();
FormsAuthenticationTicket ticket;
string cookieString;
HttpCookie cookie;
ticket = new FormsAuthenticationTicket(1,
user.Text,
DateTime.Now,
DateTime.Now.AddMinutes(30),
false,
"Data",
FormsAuthentication.FormsCookiePath);
cookieString = FormsAuthentication.Encrypt(ticket);
cookie = new HttpCookie(FormsAuthentication.FormsCookieName,
cookieString);
Response.Cookies.Add(cookie);
string strQuery = FormsAuthentication.GetRedirectUrl(user.Text,false);
Response.Redirect(strQuery);
<location path="Publisher">
<system.web>
<compilation defaultLanguage="c#" debug="true" />
<customErrors mode="Off" />
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="..\PublisherLogin.aspx" timeout="30">
</forms>
</authentication>
<authorization>
<deny users="?" />
<allow users ="*"/>
</authorization>
</system.web>
</location>
I had this problem another time but can't remember how I fixed it...
Thanks,
Joe